feat: enable optional custom date format
Adds a .Site.Params.dateFormat setting to let users specify a Hugo-style date format string for content. Previously, the date format was hardcoded to "02 Jan, 2006", presumably to match the original BearBlog style. This format gets used by default if the new "dateFormat" setting is absent from the site config.
This commit is contained in:
parent
b1fc6d298f
commit
be0ba327e3
3 changed files with 9 additions and 2 deletions
|
@ -12,7 +12,7 @@
|
|||
<span>
|
||||
<i>
|
||||
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate>
|
||||
{{ .Date.Format "02 Jan, 2006" }}
|
||||
{{ .Date.Format (default "02 Jan, 2006" .Site.Params.dateFormat) }}
|
||||
</time>
|
||||
</i>
|
||||
</span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue