diff options
| author | 南小北 <nanxiaobei@gmail.com> | 2019-04-28 23:22:34 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-28 23:22:34 +0800 |
| commit | b31a786dd00fdb556658fd8e042b2931ffeb13e6 (patch) | |
| tree | 9c0433ae204df3409b0a781996afcbc955a65c17 /layouts | |
| parent | 4b46c8cd72efecdcebc88156b0d1b0be017e63bd (diff) | |
| parent | cb6cdb37ef7289fcb3c48bb8166388011872174a (diff) | |
Merge pull request #26 from canaltinova/date-param
Add a way to change the date format with 'dateFormat' site param
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_default/list.html | 2 | ||||
| -rw-r--r-- | layouts/_default/single.html | 2 |
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> |
