Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/yanlinlin82/simple-style.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRocFang <fangpeng1986@gmail.com>2020-07-24 04:16:23 +0300
committerRocFang <fangpeng1986@gmail.com>2020-07-24 04:16:23 +0300
commit9ef91dadbe9311e99bad53fda334292b0bd3ffe5 (patch)
treeb51aaa2d2655abdade877d89a78b4465a33e0d0b
parent77811cfabec357ba55c658f79cfb933e1f9d6cb4 (diff)
support configurable date format
-rw-r--r--layouts/_default/list.html2
-rw-r--r--layouts/_default/single.html2
-rw-r--r--layouts/index.html2
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" . -}}