From: Danilo M. Date: Wed, 15 Apr 2026 13:49:00 +0000 (+0200) Subject: feat: add article header and sidebar partials supporting single article template X-Git-Tag: release_22042026-1342~270 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=0c6fa62f5104b796775a9133fbe684f5eabe08e9;p=danix.xyz-2.git feat: add article header and sidebar partials supporting single article template --- diff --git a/themes/danix-xyz-hacker/layouts/partials/article-header.html b/themes/danix-xyz-hacker/layouts/partials/article-header.html new file mode 100644 index 0000000..252d87a --- /dev/null +++ b/themes/danix-xyz-hacker/layouts/partials/article-header.html @@ -0,0 +1,53 @@ +{{ $articleType := .Params.type | default "life" }} +{{ $typeConfig := .Site.Params.articleTypes }} +{{ $typeData := index $typeConfig $articleType }} +{{ $isDark := strings.Contains (os.Getenv "THEME") "dark" }} +{{ $color := cond $isDark $typeData.color_dark $typeData.color_light }} + +
+ + {{ if $typeData }} + + {{ i18n $articleType }} + + {{ end }} + + +

+ {{ .Title }} +

+ + +
+ + {{ if .PublishDate }} +
+ + +
+ {{ end }} + + + {{ if and .LastMod (ne .LastMod.Format "2006-01-02" .PublishDate.Format "2006-01-02") }} +
+ + +
+ {{ end }} + + + {{ if .Site.Params.readingTime }} +
+ + {{ .ReadingTime }} {{ i18n "min" }} {{ i18n "readingTime" }} +
+ {{ end }} +
+
diff --git a/themes/danix-xyz-hacker/layouts/partials/sidebar.html b/themes/danix-xyz-hacker/layouts/partials/sidebar.html new file mode 100644 index 0000000..f552df9 --- /dev/null +++ b/themes/danix-xyz-hacker/layouts/partials/sidebar.html @@ -0,0 +1,22 @@ +