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:
Akira Baruah 2021-04-05 23:47:59 -07:00 committed by Jan Raasch
parent b1fc6d298f
commit be0ba327e3
3 changed files with 9 additions and 2 deletions

View file

@ -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>