Skip to content

Commit

Permalink
style:add memo
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfa committed Jan 3, 2025
1 parent ecd745a commit 0a601cf
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 31 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hugo Theme Hera

![](https://static.fatesinger.com/2024/11/ypcms5j5idcpaihf.jpg)
![](https://static.fatesinger.com/2024/12/2u80bhyxkmru4o9j.png)

## How to use

Expand All @@ -12,6 +12,12 @@ echo "theme = 'hera'" >> config.toml

## Release Note

### 0.0.2

- fixed home url error
- add memo
- add default cover

### 0.0.1

- Initial release
10 changes: 9 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Hugo 主题 Hera

a single column hugo theme with cloudflare woker support
![](https://static.fatesinger.com/2024/12/2u80bhyxkmru4o9j.png)

优雅主题

## 使用方法

Expand All @@ -12,6 +14,12 @@ echo "theme = 'hera'" >> hugo.toml

## 更新日志

### 0.0.2

- 修复首页链接错误
- 增加状态
- 增加默认封面

### 0.0.1

- 初始化
Binary file removed assets/.DS_Store
Binary file not shown.
Binary file removed assets/scss/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions assets/scss/templates/_page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
border-radius: 10px;
display: flex;
flex-direction: column;
&__img {
display: flex;
align-items: center;
}
.cover {
border-radius: 10px 10px 0 0;
aspect-ratio: 2/1;
Expand Down
4 changes: 2 additions & 2 deletions assets/ts/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ interface farallonActionsOptions {
}

class farallonActions extends farallonHelper {
singleSelector: string = ".post--single";
singleSelector: string = ".article";
likeButtonSelctor: string = ".like-btn";
articleSelector: string = ".post--item";
articleSelector: string = ".block--item";
viewSelector: string = ".article--views";
actionDomain: string;
text: string = "";
Expand Down
4 changes: 2 additions & 2 deletions assets/ts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ class noteBase {
new noteBase();

new farallonActions({
singleSelector: ".post--single",
articleSelector: ".articleItem",
singleSelector: ".article",
articleSelector: ".block--item",
text: window.viewText,
actionDomain: window.actionDomain,
});
Expand Down
5 changes: 3 additions & 2 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
<div class="navbar">
<div class="js-contentFixed">
<div class="site--info">
<a href="/"><img src="https://c.wpista.com/avatar/5ba655c9abcbd5f81a3ce0d1a88dc568?s=200&d=mm&r=x"
alt="bigfa" class="avatar"></a>
<a href="{{ site.Home.Permalink }}">{{ $logo := resources.Get "images/avatar.jpeg" }}
<img src="{{ $logo.RelPermalink }}" class="avatar" />
</a>
<div class="site--info__content">
<h1 class="site--title">{{ $.Site.Title }}</h1>
<div class="site--description"></div>
Expand Down
44 changes: 31 additions & 13 deletions layouts/partials/memo.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
<article class="post--item post--item__status" itemtype="http://schema.org/Article" itemscope="itemscope">
<div class="content">
<header>
{{ $logo := resources.Get "images/avatar.jpeg" }}
<img src="{{ $logo.RelPermalink }}" class="avatar" width="48" height="48" />
<a datetime='{{.Date.Format "2006-01-02 15:04:01" }}' class="humane--time" href="{{ .Permalink }}"
itemprop="datePublished">{{
.Date |
time.Format ":date_long"
}}</a>
</header>
<div class="description" itemprop="about">
<p>{{ .Summary | plainify | truncate 60 }}</p>
<article class="block--item block--item__status" itemtype="http://schema.org/Article" itemscope="itemscope"
data-id="{{ .File.UniqueID}}">
<div class="status--icon">
<svg viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path
d="M9.563 8.469l-0.813-1.25c-5.625 3.781-8.75 8.375-8.75 12.156 0 3.656 2.688 5.375 4.969 5.375 2.875 0 4.906-2.438 4.906-5 0-2.156-1.375-4-3.219-4.688-0.531-0.188-1.031-0.344-1.031-1.25 0-1.156 0.844-2.875 3.938-5.344zM21.969 8.469l-0.813-1.25c-5.563 3.781-8.75 8.375-8.75 12.156 0 3.656 2.75 5.375 5.031 5.375 2.906 0 4.969-2.438 4.969-5 0-2.156-1.406-4-3.313-4.688-0.531-0.188-1-0.344-1-1.25 0-1.156 0.875-2.875 3.875-5.344z">
</path>
</svg>
</div>
<div class="block--addon">
<div class="meta">
<div class="block--snippet" itemprop="about">
{{ .Summary | plainify | truncate 120 }}
</div>
<div class="block--meta">
<time datetime='{{.Date.Format "2006-01-02 15:04:01" }}' class="humane--time">{{ .Date
| time.Format
":date_long"
}}</time>
<span class="sep"></span>
{{ range (.GetTerms "categories") }}
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{ end }}
<a datetime='{{.Date.Format "2006-01-02 15:04:01" }}' class="status--link" href="{{ .Permalink }}"
itemprop="datePublished"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none"
viewBox="0 0 12 12" data-settings-arrow="true">
<path fill="#757575"
d="M.646 10.646a.5.5 0 0 0 .708.708zM11 1h.5a.5.5 0 0 0-.5-.5zm-.5 7a.5.5 0 0 0 1 0zM4 .5a.5.5 0 0 0 0 1zM1.354 11.354l10-10-.708-.708-10 10zM10.5 1v7h1V1zM4 1.5h7v-1H4z">
</path>
</svg></a>
</div>
</div>
</div>
</article>
4 changes: 2 additions & 2 deletions layouts/partials/post.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<article class="block--item" data-id="{{ .File.UniqueID}}">
<article class="block--item" data-id="{{ .File.UniqueID}}" itemtype="http://schema.org/Article" itemscope="itemscope">
<h2 class="block--title">
<a href="{{ .Permalink }}">
{{ .Title }}
Expand All @@ -7,7 +7,7 @@ <h2 class="block--title">
<div class="block--addon">
<div class="meta">
<div class="block--snippet">
<div class="summary">{{ .Summary | plainify | truncate 60 }}</div>
<div class="summary">{{ .Summary | plainify | truncate 80 }}</div>
<div class="block--meta"><time datetime='{{.Date.Format "2006-01-02 15:04:01" }}'
class="humane--time">{{ .Date
| time.Format
Expand Down
18 changes: 10 additions & 8 deletions layouts/partials/related.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ $related := .Site.RegularPages.Related . | first 4 }}
{{ with $related }}
<div class="related--content">
<h3 class="related--posts__title">{{ i18n "article.relatedContent" }}</h3>
Expand All @@ -10,17 +10,19 @@ <h3 class="related--posts__title">{{ i18n "article.relatedContent" }}</h3>
{{ if .Content }}
{{ $urls := findRE "<img src=\"[^\"|\\\"]*\"" .Content }} {{ if $urls }} {{ $url :=index ($urls) 0
}} {{ $url :=(strings.TrimPrefix "<img src=\"" $url) }}
{{ $url := strings.TrimRight " \"" $url }} <img src="{{ $url }}" class="cover" /> {{
end }} {{ end }}
{{ $url := strings.TrimRight " \"" $url }} <img src="{{ $url }}" class="cover" />
{{ else }}
<img src="{{ .Site.Params.defaultCover }}" class="cover" />
{{ end }}
{{ end }}
</div>
<div class="post--single__related__item__title">
{{ .Title }}</div>
<div class="meta">
<time class="humane--time"><time datetime='{{.Date.Format "2006-01-02 15:04:01" }}'
class="humane--time">{{ .Date
| time.Format
":date_long"
}}</time></time>
<time datetime='{{.Date.Format "2006-01-02 15:04:01" }}' class="humane--time">{{ .Date
| time.Format
":date_long"
}}</time>
</div>
</a>
</div>
Expand Down

0 comments on commit 0a601cf

Please sign in to comment.