diff options
author | Linlin Yan (颜林林) <yanlinlin82@gmail.com> | 2020-07-29 02:53:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-29 02:53:17 +0300 |
commit | d316e60cd7ad96cdc48f25567149c714af095ac8 (patch) | |
tree | b51aaa2d2655abdade877d89a78b4465a33e0d0b | |
parent | 77811cfabec357ba55c658f79cfb933e1f9d6cb4 (diff) | |
parent | 9ef91dadbe9311e99bad53fda334292b0bd3ffe5 (diff) |
Merge pull request #4 from RocFang/dateFormat
support configurable date format
-rw-r--r-- | layouts/_default/list.html | 2 | ||||
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/index.html | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 978cf16..a1bb075 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -4,7 +4,7 @@ </div> <ul> {{ range .Paginator.Pages -}} - <li>{{ .Date.Format "2006-01-02 15:04" }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + <li>{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a></li> {{ end -}} </ul> {{ template "_internal/pagination.html" . -}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d9425f9..b407510 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -10,7 +10,7 @@ </div> <div class="meta"> {{ if .Date -}} - <div>{{ .Date.Format "2006-01-02 15:04" }}</div> + <div>{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }}</div> {{ end -}} {{ $taxo := "tags" -}} {{ if .Param $taxo -}} diff --git a/layouts/index.html b/layouts/index.html index 02cc477..5537f06 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -4,7 +4,7 @@ </div> <ul> {{ range (.Paginate ( where .Site.RegularPages "Type" "in" site.Params.mainSections )).Pages -}} - <li>{{ .Date.Format "2006-01-02 15:04" }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a></li> + <li>{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }} - <a href="{{ .RelPermalink }}">{{ .Title }}</a></li> {{ end -}} </ul> {{ template "_internal/pagination.html" . -}} |