From c4232b6e28a9465256ee70a314ccd6659cc00eb1 Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Sat, 14 Dec 2019 13:31:11 +0100 Subject: #113, Hide date from posts if not specified --- layouts/posts/single.html | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'layouts/posts/single.html') diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 61c2130..69352cd 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -1,14 +1,16 @@ {{ define "main" }} -{{ $dateFormat := default "January 2, 2006" .Site.Params.BookDateFormat }} -
-

{{ .Title }}

-
- {{ .Date.Format $dateFormat }} -
-
-
- {{- .Content -}} -
+ {{ $dateFormat := default "January 2, 2006" .Site.Params.BookDateFormat }} +
+

{{ .Title }}

+ {{ with .Date }} +
+ {{ .Format $dateFormat }} +
+ {{ end }} +
+
+ {{- .Content -}} +
{{ end }} {{ define "toc" }} -- cgit v1.2.3