mirror of
https://git.adityakumar.xyz/hugo-theme-even.git
synced 2024-11-09 14:59:45 +00:00
feat: provide the facility to customize date format (#10)
This commit is contained in:
parent
271f73a87f
commit
ab7cdc5d3c
5 changed files with 7 additions and 4 deletions
|
@ -51,6 +51,9 @@ copyright = "" # default: author.name ↓ # 默认为下面配
|
|||
|
||||
# paginate of archives, tags and categories # 归档、标签、分类每页显示的文章数目
|
||||
archive-paginate = 3
|
||||
|
||||
# The date format to use; for a list of valid formats, see https://gohugo.io/functions/format/
|
||||
dateFormatToUse = "2006-01-02"
|
||||
|
||||
# show word count and read time ? # 是否显示字数统计与阅读时间
|
||||
moreMeta = false
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{{ range $paginator.Pages }}
|
||||
<div class="archive-post">
|
||||
<span class="archive-post-time">
|
||||
{{ .Date.Format "2006-01-02" }}
|
||||
{{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
|
||||
</span>
|
||||
<span class="archive-post-title">
|
||||
<a href="{{ .URL }}" class="archive-post-link">
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
</p>
|
||||
<p class="copyright-item">
|
||||
<span class="item-title">{{ $lang.copyright.lastMod }}</span>
|
||||
<span class="item-content">{{ .Lastmod.Format "2006-01-02" }}</span>
|
||||
<span class="item-content">{{ .Lastmod.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}</span>
|
||||
</p>
|
||||
{{ if $.Site.Params.linkToMarkDown -}}
|
||||
{{ with $.OutputFormats.Get "markdown" -}}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<h1 class="post-title">{{ .Title }}</h1>
|
||||
|
||||
<div class="post-meta">
|
||||
<span class="post-time"> {{ .Date.Format "2006-01-02" }} </span>
|
||||
<span class="post-time"> {{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }} </span>
|
||||
{{ with .Params.categories -}}
|
||||
<div class="post-category">
|
||||
{{ range . -}}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<header class="post-header">
|
||||
<h1 class="post-title"><a class="post-link" href="{{ .URL }}">{{ .Title }}</a></h1>
|
||||
<div class="post-meta">
|
||||
<span class="post-time"> {{ .Date.Format "2006-01-02" }} </span>
|
||||
<span class="post-time"> {{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }} </span>
|
||||
{{ with .Params.categories -}}
|
||||
<div class="post-category">
|
||||
{{ range . -}}
|
||||
|
|
Loading…
Reference in a new issue