Merge pull request #26 from canaltinova/date-param

Add a way to change the date format with 'dateFormat' site param
This commit is contained in:
南小北 2019-04-28 23:22:34 +08:00 committed by GitHub
commit b31a786dd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@
<p>{{ .Summary | plainify | htmlUnescape }}...</p>
</section>
<footer class="entry-footer">
<time >{{ .Date.Format "2006.1.2" }}</time>
<time>{{ .Date.Format (.Site.Params.dateFormat | default "2006.1.2") }}</time>
</footer>
<a class="entry-link" href="{{ .Permalink }}"></a>
</article>

View File

@ -6,7 +6,7 @@
<div class="post-meta">
{{- if or .Params.author .Site.Params.author -}}
{{ .Params.author | default .Site.Params.author }} · {{ end }}
{{- .Date.Format "2006.1.2" -}}
{{- .Date.Format (.Site.Params.dateFormat | default "2006.1.2") -}}
</div>
</header>
<div class="post-content">{{ .Content }}</div>