From 911726a510b183ae5020430ea8bb32bf71bbbd44 Mon Sep 17 00:00:00 2001 From: fundor333 Date: Sat, 13 Jul 2024 02:25:43 +0200 Subject: [PATCH] Add update time --- config/_default/config.yaml | 1 + themes/fugu/layouts/post/single.html | 19 ++++++++++++++++--- themes/fugu/layouts/post/summary.html | 18 ++++++++++++++++-- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/config/_default/config.yaml b/config/_default/config.yaml index a17ce233..d076a055 100644 --- a/config/_default/config.yaml +++ b/config/_default/config.yaml @@ -13,6 +13,7 @@ disableRSS: false enableRobotsTXT: true Paginate: 8 rssLimit: 10 +enableGitInfo: true related: includeNewer: true threshold: 70 diff --git a/themes/fugu/layouts/post/single.html b/themes/fugu/layouts/post/single.html index 403f4d04..9cfe5a18 100644 --- a/themes/fugu/layouts/post/single.html +++ b/themes/fugu/layouts/post/single.html @@ -4,8 +4,13 @@ {{ end }} - {{ define "main"}} + +{{ $date := .Date.Format "2006-01-02" }} +{{ $lastmod := .Lastmod.Format "2006-01-02" }} + +{{ $date_h := .Date.Format "2006-01-02 15:04:05" }} +{{ $lastmod_h := .Lastmod.Format "2006-01-02 15:04:05" }}

{{ .Title }} {{ .Description }} - {{ range .Params.categories }}#{{ .}} {{ end }}{{ with .Params.tags }}{{ range sort . }}#{{ .}} {{ end }}{{ end }}

@@ -36,8 +41,16 @@
- {{ .Date | time.Format "2006-01-02" }} | - {{ range .Params.categories }} + + {{ $date }} | + {{if ne $lastmod $date}} + + + {{ $lastmod }} | + {{ end }} + + + {{ range .Params.categories }} #{{ .}}, {{ end }} {{ with .Params.tags }} {{ range sort . }} diff --git a/themes/fugu/layouts/post/summary.html b/themes/fugu/layouts/post/summary.html index 071ccc48..cef035ad 100644 --- a/themes/fugu/layouts/post/summary.html +++ b/themes/fugu/layouts/post/summary.html @@ -1,3 +1,9 @@ +{{ $date := .Date.Format "2006-01-02" }} +{{ $lastmod := .Lastmod.Format "2006-01-02" }} + +{{ $date_h := .Date.Format "2006-01-02 15:04:05" }} +{{ $lastmod_h := .Lastmod.Format "2006-01-02 15:04:05" }} +