mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 09:12:47 +00:00
fix: do not render a date if it is not set
fixes the issue where posts without a date render a date of "January 1, 0001"
This commit is contained in:
parent
cc963b323f
commit
81d13b5936
@ -29,10 +29,12 @@
|
|||||||
</strong>
|
</strong>
|
||||||
</p>
|
</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{/* Hugo uses Go's date formatting is set by example. Here are two formats */}}
|
{{/* Hugo uses Go's date formatting is set by example. Here are two formats. */}}
|
||||||
|
{{ if .Date }}
|
||||||
<time class="f6 mv4 dib tracked" {{ printf `datetime="%s"` (.Date.Format "2006-01-02T15:04:05Z07:00") | safeHTMLAttr }}>
|
<time class="f6 mv4 dib tracked" {{ printf `datetime="%s"` (.Date.Format "2006-01-02T15:04:05Z07:00") | safeHTMLAttr }}>
|
||||||
{{- .Date.Format "January 2, 2006" -}}
|
{{- .Date.Format "January 2, 2006" -}}
|
||||||
</time>
|
</time>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Show "reading time" and "word count" but only if one of the following are true:
|
Show "reading time" and "word count" but only if one of the following are true:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user