use .Lastmod instead of .Date on posts

This commit is contained in:
Robert Kaussow 2020-08-25 23:33:35 +02:00
parent c2d910f078
commit 536f5322f3
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
4 changed files with 11 additions and 3 deletions

View File

@ -1,2 +1,4 @@
- ENHANCEMENT - ENHANCEMENT
- add template for Json Feeds - slightly change the date formate displayed on posts
- use `.Lastmod` instead of `.Date` on posts
the date on updated posts will be prefixed with `Updated on` string

View File

@ -4,6 +4,7 @@ title: Geekblog
theme: hugo-geekblog theme: hugo-geekblog
pygmentsUseClasses: true pygmentsUseClasses: true
pygmentsCodeFences: true pygmentsCodeFences: true
enableGitInfo: true
paginate: 5 paginate: 5

View File

@ -48,6 +48,7 @@ theme = "hugo-geekblog"
# Required to get well formatted code blocks # Required to get well formatted code blocks
pygmentsUseClasses = true pygmentsUseClasses = true
pygmentsCodeFences = true pygmentsCodeFences = true
enableGitInfo = true
disablePathToLower = true disablePathToLower = true
enableGitInfo = true enableGitInfo = true
@ -148,6 +149,7 @@ theme: hugo-geekblog
# Required to get well formatted code blocks # Required to get well formatted code blocks
pygmentsUseClasses: true pygmentsUseClasses: true
pygmentsCodeFences: true pygmentsCodeFences: true
enableGitInfo: true
disablePathToLower: true disablePathToLower: true
enableGitInfo: true enableGitInfo: true

View File

@ -24,8 +24,11 @@
<span class="no-wrap"> <span class="no-wrap">
<svg class="icon date"><use xlink:href="#date"></use></svg> <svg class="icon date"><use xlink:href="#date"></use></svg>
<span class="gblog-post__tag"> <span class="gblog-post__tag">
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}"> <time datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
{{ .Date.Day }} {{ .Date.Month }} {{ .Date.Year }} {{ if ne .Lastmod .Date }}
Updated on
{{ end }}
{{ .Lastmod.Format "Jan 2, 2006" }}
</time> </time>
</span> </span>
</span> </span>