blog

My blog at www.shimmy1996.com

git clone git://git.shimmy1996.com/blog.git
commit 2c2070cdd9cc24b2226bedfaea9159f11fc7bf53
parent 0cf5911762f3696ca076c6129468f6b589a967cd
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Sun, 11 Feb 2018 22:58:01 -0600

Do not display date if unspecified (.Params.date now has default value).

Diffstat:
Mlayouts/_default/single.html | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -2,7 +2,7 @@
 <div class="article-meta">
 <h1><span class="title">{{ .Title }}</span></h1>
 {{ with .Params.author }}<h2 class="author">{{ . }}</h2>{{ end }}
-{{ if .Params.date }}<h2 class="date">{{ .Date.Format "2006/01/02" }}</h2>{{ end }}
+{{ if (lt 0 .Params.date) }}<h2 class="date">{{ .Date.Format "2006/01/02" }}</h2>{{ end }}
 <p class="terms">
   {{ range $i := (slice "categories" "tags") }}
   {{ with ($.Param $i) }}