From 1ae24ada388e9581878c80b747e8afa10cc22475 Mon Sep 17 00:00:00 2001
From: Ian Anderson <andrsn84@gmail.com>
Date: Fri, 01 Oct 2021 17:14:07 +0000
Subject: [PATCH] Only print article date if it is non-zero (#397)
---
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:
--
Gitblit v1.10.0