diff options
author | Alex Shpak <alex-shpak@users.noreply.github.com> | 2019-12-14 13:31:11 +0100 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2019-12-14 13:31:11 +0100 |
commit | c4232b6e28a9465256ee70a314ccd6659cc00eb1 (patch) | |
tree | 1cccdef871a508f06bd53bf9deff104aa281dab0 /layouts/posts/single.html | |
parent | e01674c287fd18c9ef01d11888a83283a2439380 (diff) |
#113, Hide date from posts if not specified
Diffstat (limited to 'layouts/posts/single.html')
-rw-r--r-- | layouts/posts/single.html | 22 |
1 files changed, 12 insertions, 10 deletions
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 }} -<header class="markdown"> - <h1>{{ .Title }}</h1> - <h5> - <strong>{{ .Date.Format $dateFormat }}</strong> - </h5> -</header> -<article class="markdown"> - {{- .Content -}} -</article> + {{ $dateFormat := default "January 2, 2006" .Site.Params.BookDateFormat }} + <header class="markdown"> + <h1>{{ .Title }}</h1> + {{ with .Date }} + <h5> + <strong>{{ .Format $dateFormat }}</strong> + </h5> + {{ end }} + </header> + <article class="markdown"> + {{- .Content -}} + </article> {{ end }} {{ define "toc" }} |