🔧 🐛 Fixed #109 & change post date display.

This commit is contained in:
elkan1788
2024-11-30 20:38:49 +08:00
parent fdfcadadcc
commit ae09494361
4 changed files with 13 additions and 8 deletions

View File

@@ -1,3 +1,4 @@
{{/** Calculate some information for site operation **/}}
{{ $scratch := newScratch }}
{{ $pages := (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections).ByLastmod.Reverse }}
@@ -7,10 +8,11 @@
{{ end }}
{{ range first 1 $pages }}
{{ $scratch.Set "first" (time.Format .Site.Params.timeFormat .Date) }}
{{ $lastMod := default .Date .Lastmod }}
{{ $scratch.Set "first" $lastMod }}
{{ end }}
{{ range last 1 $pages }}
{{ $scratch.Set "last" (time.Format .Site.Params.timeFormat .Date) }}
{{ $scratch.Set "last" .Date }}
{{ end }}
{{ return $scratch }}