Add paigedateformat site parameter
This commit is contained in:
@@ -82,7 +82,8 @@ pages `content/foo/_index.md`, `content/foo/bar.md`, and
|
|||||||
page `content/_index.md`.
|
page `content/_index.md`.
|
||||||
|
|
||||||
The page date is the publish date, if any; otherwise, it's the creation
|
The page date is the publish date, if any; otherwise, it's the creation
|
||||||
date.
|
date. To change the date format displayed, set the site parameter
|
||||||
|
`paigedateformat` to a Hugo date format.
|
||||||
|
|
||||||
The home page body has the `stretch`, `center`, `greeting`, and `blurb`
|
The home page body has the `stretch`, `center`, `greeting`, and `blurb`
|
||||||
parameters from `content/_index.md`, if any; the page content, if any;
|
parameters from `content/_index.md`, if any; the page content, if any;
|
||||||
|
@@ -1,3 +1,7 @@
|
|||||||
{{ with .PublishDate }}
|
{{ with .PublishDate }}
|
||||||
<p class="text-center text-muted"><time datetime="{{ .Format `2006-01-02` }}">{{ .Format "January 2, 2006" }}</time></p>
|
{{ $format := ":date_long" }}
|
||||||
|
{{ with site.Params.paigedateformat }}
|
||||||
|
{{ $format = . }}
|
||||||
|
{{ end }}
|
||||||
|
<p class="text-center text-muted"><time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $format . }}</time></p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Reference in New Issue
Block a user