mirror of
https://git.adityakumar.xyz/hugo-theme-even.git
synced 2024-11-14 00:49:44 +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
|
@ -52,6 +52,9 @@ copyright = "" # default: author.name ↓ # 默认为下面配
|
||||||
# paginate of archives, tags and categories # 归档、标签、分类每页显示的文章数目
|
# paginate of archives, tags and categories # 归档、标签、分类每页显示的文章数目
|
||||||
archive-paginate = 3
|
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 ? # 是否显示字数统计与阅读时间
|
# show word count and read time ? # 是否显示字数统计与阅读时间
|
||||||
moreMeta = false
|
moreMeta = false
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
{{ range $paginator.Pages }}
|
{{ range $paginator.Pages }}
|
||||||
<div class="archive-post">
|
<div class="archive-post">
|
||||||
<span class="archive-post-time">
|
<span class="archive-post-time">
|
||||||
{{ .Date.Format "2006-01-02" }}
|
{{ .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}
|
||||||
</span>
|
</span>
|
||||||
<span class="archive-post-title">
|
<span class="archive-post-title">
|
||||||
<a href="{{ .URL }}" class="archive-post-link">
|
<a href="{{ .URL }}" class="archive-post-link">
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
</p>
|
</p>
|
||||||
<p class="copyright-item">
|
<p class="copyright-item">
|
||||||
<span class="item-title">{{ $lang.copyright.lastMod }}</span>
|
<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>
|
</p>
|
||||||
{{ if $.Site.Params.linkToMarkDown -}}
|
{{ if $.Site.Params.linkToMarkDown -}}
|
||||||
{{ with $.OutputFormats.Get "markdown" -}}
|
{{ with $.OutputFormats.Get "markdown" -}}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<h1 class="post-title">{{ .Title }}</h1>
|
<h1 class="post-title">{{ .Title }}</h1>
|
||||||
|
|
||||||
<div class="post-meta">
|
<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 -}}
|
{{ with .Params.categories -}}
|
||||||
<div class="post-category">
|
<div class="post-category">
|
||||||
{{ range . -}}
|
{{ range . -}}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<header class="post-header">
|
<header class="post-header">
|
||||||
<h1 class="post-title"><a class="post-link" href="{{ .URL }}">{{ .Title }}</a></h1>
|
<h1 class="post-title"><a class="post-link" href="{{ .URL }}">{{ .Title }}</a></h1>
|
||||||
<div class="post-meta">
|
<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 -}}
|
{{ with .Params.categories -}}
|
||||||
<div class="post-category">
|
<div class="post-category">
|
||||||
{{ range . -}}
|
{{ range . -}}
|
||||||
|
|
Loading…
Reference in a new issue