Set default value of DateFormat param #50

This commit is contained in:
koirand 2019-05-18 22:27:23 +09:00
parent e902efea9d
commit 404716b9e5
3 changed files with 6 additions and 4 deletions

View file

@ -2,7 +2,8 @@
<h1>{{ .Title }}</h1>
{{ partial "header.html" . }}
<!-- date -->
<p class="date">{{ .Date.Format .Site.Params.singlePageDateFormat }}</p>
{{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}
<p class="date">{{ .Date.Format $singlePageDateFormat }}</p>
<!-- content -->
<div id="contentBody">
{{ .Content }}