summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Olech <nddr89@gmail.com>2021-10-29 01:05:21 +0200
committerAdam Olech <nddr89@gmail.com>2021-10-29 01:05:21 +0200
commit009295b17cda9fed86ac6379997e078e1dd3bec4 (patch)
tree4574b7d229105cb17f794d3bf8b69994e03f9569
parentc1cff37da62087403680cef143f2a2c3089a88d2 (diff)
_default/list.html: don't show date if not set
-rw-r--r--layouts/_default/list.html8
1 files changed, 5 insertions, 3 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 917ca38..a76be32 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -5,9 +5,11 @@
<li>
<div class="flex">
<a href="{{ .Permalink }}" class="truncate">{{ .Title }}</a>
- {{ if eq .Kind "page" }}
- <time class="nowrap" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
- {{ end }}
+ {{ if not .Date.IsZero }}
+ {{ if eq .Kind "page" }}
+ <time class="nowrap" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
+ {{ end }}
+ {{ end }}
</div>
</li>
{{- end }}