diff options
author | Ian Anderson <andrsn84@gmail.com> | 2021-10-01 20:14:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-01 20:14:07 +0300 |
commit | 1ae24ada388e9581878c80b747e8afa10cc22475 (patch) | |
tree | fdae3efdf7c0721a05d873d68d742ebd05c6eec6 | |
parent | 597a631988526380e81061f778f85eff43653a5d (diff) |
Only print article date if it is non-zero (#397)
-rwxr-xr-x | layouts/_default/single.html | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7cf01e2..2f2eed3 100755 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -30,9 +30,11 @@ </p> {{ end }} {{/* Hugo uses Go's date formatting is set by example. Here are two formats */}} + {{ if not .Date.IsZero }} <time class="f6 mv4 dib tracked" {{ printf `datetime="%s"` (.Date.Format "2006-01-02T15:04:05Z07:00") | safeHTMLAttr }}> {{- .Date.Format "January 2, 2006" -}} </time> + {{end}} {{/* Show "reading time" and "word count" but only if one of the following are true: |