mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2026-01-08 03:55:26 -05:00
add lastmod support
This commit is contained in:
parent
f625367ff7
commit
ddaf94cd3d
2 changed files with 9 additions and 0 deletions
|
|
@ -19,6 +19,9 @@
|
|||
{{- partial "edit_post.html" . -}}
|
||||
{{- partial "post_canonical.html" . -}}
|
||||
</div>
|
||||
<div class="post-meta">
|
||||
{{- partial "post_lastmod.html" . -}}
|
||||
</div>
|
||||
{{- end }}
|
||||
</header>
|
||||
{{- $isHidden := .Params.cover.hidden | default site.Params.cover.hiddenInSingle | default site.Params.cover.hidden }}
|
||||
|
|
|
|||
6
layouts/partials/post_lastmod.html
Normal file
6
layouts/partials/post_lastmod.html
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{{ $date := .Date.Format "02.01.2006" }}
|
||||
{{ $lastmod := .Lastmod.Format "02.01.2006" }}
|
||||
|
||||
{{- if ne $lastmod $date -}}
|
||||
<span title={{ .Lastmod }}><i>Last updated on {{ .Lastmod | time.Format (default "January 2, 2006" site.Params.DateFormat) }}</i></span>
|
||||
{{- end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue