fix for pages with no date value

About pages and similar might not have a meaningful date value, so avoid
formatting the value if not present, since that would output a
nonsensical value like “January 1, 0001”.
This commit is contained in:
Mikkel Hoegh
2020-03-08 22:33:55 +01:00
parent a4a6ec7e94
commit 721e229177

View File

@@ -1,6 +1,8 @@
{{ define "main" }} {{ define "main" }}
<h1 class="post-title">{{ .Title }}</h1> <h1 class="post-title">{{ .Title }}</h1>
{{ if .Date }}
<time>{{ .Date.Format "January 2, 2006" }}</time> <time>{{ .Date.Format "January 2, 2006" }}</time>
{{ end }}
<div> <div>
<p> <p>
{{ .Content }} {{ .Content }}