From 721e2291773acdacc7b9a03c471ab1d64ba0df3d Mon Sep 17 00:00:00 2001
From: Mikkel Hoegh <mikkel@hoegh.org>
Date: Sun, 8 Mar 2020 22:33:55 +0100
Subject: [PATCH] fix for pages with no date value
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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”.
---
 layouts/_default/single.html | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index a3a7451..d78a6c0 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,6 +1,8 @@
 {{ define "main" }}
 <h1 class="post-title">{{ .Title }}</h1>
+    {{ if .Date }}
     <time>{{ .Date.Format "January 2, 2006" }}</time>
+    {{ end }}
     <div>
         <p>
         {{ .Content }}