single and list - add last mod date display, float right

params - add .LastModDisplay string to enable/disable
This commit is contained in:
Adam Ormsby 2019-11-10 14:54:22 +07:00
parent 1dd80e76b5
commit d12d24411e
2 changed files with 18 additions and 0 deletions

View File

@ -17,6 +17,13 @@
<span class="post-date"> <span class="post-date">
{{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }} {{ .Date.Format ($.Site.Params.DateFormatList | default "2006-01-02") }}
</span> </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 }} {{ end }}
{{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }} {{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
{{ if $.Site.Params.ShowReadingTime }} {{ if $.Site.Params.ShowReadingTime }}

View File

@ -7,6 +7,17 @@
{{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }} {{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }}
</span> </span>
{{ end }} {{ 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 }} {{ with .Params.Author }}<span class="post-author">— {{ $.Site.Params.WrittenBy | default "Written by" }} {{ . }}</span>{{ end }}
{{ if $.Site.Params.ShowReadingTime }} {{ if $.Site.Params.ShowReadingTime }}
<span class="post-read-time">— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span> <span class="post-read-time">— {{ .ReadingTime }} {{ $.Site.Params.MinuteReadingTime | default "min read" }}</span>