If nodate is set do not show the date line.

For pages like about or bio or things like that, people may not want to have a date line.

With this change, you can have `nodate = true` set for a page to suppress the date.
This commit is contained in:
Emin Martinian 2018-12-27 20:06:39 -05:00 committed by GitHub
parent 3e1e728712
commit 65d1858438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,9 +19,13 @@
{{- .Title -}}
</h1>
{{/* Hugo uses Go's date formatting is set by example. Here are two formats */}}
{{ if not .Params.nodate }}
<time class="f6 mv4 dib tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{- .Date.Format "January 2, 2006" -}}
</time>
{{ else }}
<!-- hiding date since nodate = true set in source -->
{{ end }}
{{/*
Show "reading time" and "word count" but only if one of the following are true:
1) A global config `params` value is set `show_reading_time = true`