Skip to content

Commit

Permalink
fix publish time in home page
Browse files Browse the repository at this point in the history
  • Loading branch information
weearc authored and axionl committed Feb 28, 2024
1 parent 7271db9 commit 038ecf3
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/axionl.github.io-fork.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 86 additions & 0 deletions i18n/zh-cn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
toggleMenu:
other: 切换菜单

darkMode:
other: 暗色模式

article:
back:
other: 返回

tableOfContents:
other: 目录

relatedContent:
other: 相关文章

lastUpdatedOn:
other: 最后更新于

readingTime:
other: "阅读时长: {{ .Count }} 分钟"

notFound:
title:
other: 404 错误
subtitle:
other: 页面不存在

widget:
archives:
title:
other: 归档

more:
other: 更多

tagCloud:
title:
other: 标签云

categoriesCloud:
title:
other: 分类

search:
title:
other: 搜索

placeholder:
other: 输入关键词...

resultTitle:
other: "#PAGES_COUNT 个结果 (用时 #TIME_SECONDS 秒)"

footer:
builtWith:
other: Built with {{ .Generator }}

designedBy:
other: 主题 {{ .Theme }} 由 {{ .DesignedBy }} 设计

home:
- id: 1月
translation: Jan
- id: 2月
translation: Feb
- id: 3月
translation: Mar
- id: 4月
translation: Apr
- id: 5月
translation: May
- id: 6月
translation: Jun
- id: 7月
translation: Jul
- id: 8月
translation: Aug
- id: 9月
translation: Sep
- id: 10月
translation: Oct
- id: 11月
translation: Nov
- id: 12月
translation: Dec
64 changes: 64 additions & 0 deletions layouts/partials/article/components/details.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<div class="article-details">
{{ if .Params.categories }}
<header class="article-category">
{{ range (.GetTerms "categories") }}
<a href="{{ .RelPermalink }}" {{ with .Params.style }}style="background-color: {{ .background }}; color: {{ .color }};"{{ end }}>
{{ .LinkTitle }}
</a>
{{ end }}
</header>
{{ end }}

<div class="article-title-wrapper">
<h2 class="article-title">
<a href="{{ .RelPermalink }}">
{{- .Title -}}
</a>
</h2>

{{ with .Params.description }}
<h3 class="article-subtitle">
{{ . }}
</h3>
{{ end }}
</div>

{{ $showReadingTime := .Params.readingTime | default (.Site.Params.article.readingTime) }}
{{ $showDate := not .Date.IsZero }}
{{ $showFooter := or $showDate $showReadingTime }}
{{ if $showFooter }}
<footer class="article-time">
{{ if $showDate }}
<div>
{{ partial "helper/icon" "date" }}
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $monthHuman := .Date | time.Format "Jan" }}
{{ $dateHuman := .Date | time.Format "02, 2006" }}
<time class="article-time--published" datetime="{{ $dateMachine }}">
{{$monthHuman}} {{ $dateHuman }}
</time>
</div>
{{ end }}

{{ if $showReadingTime }}
<div>
{{ partial "helper/icon" "clock" }}
<time class="article-time--reading">
{{ T "article.readingTime" .ReadingTime }}
</time>
</div>
{{ end }}
</footer>
{{ end }}

{{ if .IsTranslated }}
<footer class="article-translations">
{{ partial "helper/icon" "language" }}
<div>
{{ range .Translations }}
<a href="{{ .Permalink }}" class="link">{{ .Language.LanguageName }}</a>
{{ end }}
</div>
</footer>
{{ end }}
</div>

0 comments on commit 038ecf3

Please sign in to comment.