Addad param for dateformat.

This commit is contained in:
Fredrik Jonsson 2017-05-18 14:12:32 +02:00
commit 38a7cfc25b
3 changed files with 4 additions and 2 deletions

View file

@ -63,6 +63,8 @@ params:
cacheBustJS: true # Add a cache busting hash on script.js
sidebar: true # Show a sidebar to the right
submitted: false # Show author and date information for a post.
dateformat: "" # Set the date format, default to "2 January, 2006"
```

View file

@ -1 +1 @@
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a> {{ .Date }}</li>
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a> – {{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</li>

View file

@ -1,4 +1,4 @@
<p class="submitted">
{{ with $.Param "author" }}<span class="author">{{ . }}</span> – {{ end -}}
<span class="created-date">{{ .Date.Format "2 January, 2006" }}</span>
<span class="created-date">{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</span>
</p>