hide updated date if equal to created date

This commit is contained in:
T2hhbmEK 2023-01-22 05:50:22 +08:00
parent 9e657da94a
commit e1ed2b5e09
No known key found for this signature in database
GPG Key ID: D412878779B8898C

View File

@ -7,7 +7,9 @@
{{ if .Date }} {{ if .Date }}
<time class="post-date"> <time class="post-date">
{{ .Date.Format "2006-01-02" }} :: {{ .Date.Format "2006-01-02" }} ::
{{ if $.Site.Params.showLastUpdated }} {{ $showLastUpdated := ne (.Date.Format "2006-01-02") (.Lastmod.Format "2006-01-02")}}
{{ $showLastUpdated := and $showLastUpdated $.Site.Params.showLastUpdated }}
{{ if $showLastUpdated }}
[{{or $.Site.Params.updatedDatePrefix "Updated"}} :: {{ .Lastmod.Format "2006-01-02" }}] [{{or $.Site.Params.updatedDatePrefix "Updated"}} :: {{ .Lastmod.Format "2006-01-02" }}]
{{ end }} {{ end }}
</time> </time>