summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNazım Can Altınova <canaltinova@gmail.com>2019-04-28 15:54:18 +0200
committerNazım Can Altınova <canaltinova@gmail.com>2019-04-28 15:56:39 +0200
commitcb6cdb37ef7289fcb3c48bb8166388011872174a (patch)
tree9c0433ae204df3409b0a781996afcbc955a65c17
parent4b46c8cd72efecdcebc88156b0d1b0be017e63bd (diff)
Add a way to change the date format with 'dateFormat' site param
-rw-r--r--layouts/_default/list.html2
-rw-r--r--layouts/_default/single.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 76ddfcd..38b6dda 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -20,7 +20,7 @@
<p>{{ .Summary | plainify | htmlUnescape }}...</p>
</section>
<footer class="entry-footer">
- <time >{{ .Date.Format "2006.1.2" }}</time>
+ <time>{{ .Date.Format (.Site.Params.dateFormat | default "2006.1.2") }}</time>
</footer>
<a class="entry-link" href="{{ .Permalink }}"></a>
</article>
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 60bc6f9..c69e4c3 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -6,7 +6,7 @@
<div class="post-meta">
{{- if or .Params.author .Site.Params.author -}}
{{ .Params.author | default .Site.Params.author }} · {{ end }}
- {{- .Date.Format "2006.1.2" -}}
+ {{- .Date.Format (.Site.Params.dateFormat | default "2006.1.2") -}}
</div>
</header>
<div class="post-content">{{ .Content }}</div>