mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-14 12:25:07 +01:00
New feature - Display last modified date on post content in both list and single layouts if it exists.
config param added - LastModDisplay - empty string = nothing displayed, string w/ value = display the value and then the date. Example - lastModDisplay = "Updated: " - displayed as "Updated: [lastmod date]"
This commit is contained in:
parent
8759dd6b38
commit
a8037bfbe8
@ -17,6 +17,13 @@
|
||||
<span class="post-date">
|
||||
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
|
||||
</span>
|
||||
{{ if $.Site.Params.LastModDisplay}}
|
||||
{{ with .Lastmod }}
|
||||
<span class="post-moddate">
|
||||
{{ $.Site.Params.LastModDisplay }} {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
|
@ -7,6 +7,17 @@
|
||||
{{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ if $.Site.Params.LastModDisplay}}
|
||||
{{ if .Date }}
|
||||
{{ with .Lastmod }}
|
||||
<span class="post-moddate">
|
||||
{{ $.Site.Params.LastModDisplay }} {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
|
||||
{{ if $.Site.Params.ShowReadingTime }}
|
||||
<span class="post-read-time">— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span>
|
||||
|
Loading…
Reference in New Issue
Block a user