From 3819a1c017289c4e65965467cf8e81c83b0993cf Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 20 Dec 2025 22:34:55 +0100 Subject: [PATCH] =?utf8?q?`section`-Template=20f=C3=BCr=20den=20Blog=20?= =?utf8?q?=C3=BCberarbeitet=20und=20RSS-Ausgabe=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- hugo.yaml | 5 +++++ layouts/blog/section.html | 39 ++++----------------------------------- layouts/rss.xml | 27 +++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 35 deletions(-) create mode 100644 layouts/rss.xml diff --git a/hugo.yaml b/hugo.yaml index 4d9d6b77..bdd51f41 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -1,4 +1,5 @@ baseURL: https://example.org/ +copyright: Kai Moritz languageCode: en-US mainSections: - blog @@ -10,4 +11,8 @@ module: hugoVersion: extended: false min: 0.152.0 +params: + author: + email: kai@juplo.de + name: Kai Moritz title: Thymeleaf-Theme for Thymeroot diff --git a/layouts/blog/section.html b/layouts/blog/section.html index acac1bb4..4dc240e5 100644 --- a/layouts/blog/section.html +++ b/layouts/blog/section.html @@ -1,45 +1,21 @@ {{- define "title" }}

- {{ .Title }} - {{- if (.Param "ShowRssButtonInSectionTermList") }} - {{- $rss := (.OutputFormats.Get "rss") }} - {{- if (eq .Kind `page`) }} - {{- $rss = (.Parent.OutputFormats.Get "rss") }} - {{- end }} - {{- with $rss }} + {{- with .OutputFormats.Get "rss" }} - + Archive of all Blog-Articles - {{- end }} - {{- end }}

- {{- if .Description }} -
- {{ .Description }} -
{{- end }} {{- end }}{{/* end title */}} {{- define "main" }} -{{- range .Pages.GroupByPublishDate "2006" }} -{{- if ne .Key "0001" }} -
- {{- $year := replace .Key "0001" "" }} -

- - {{- $year -}} - -

- {{- range .Pages.GroupByDate "January" }} -
-
- {{- range .Pages }} - {{- if eq .Kind "page" }} +{{- range .RegularPagesRecursive }}

{{- .Title | markdownify }} @@ -56,12 +32,5 @@ {{- partial "post_meta.html" . -}}

- {{- end }} - {{- end }} -
-
- {{- end }} - -{{- end }} {{- end }} {{- end }}{{/* end main */}} diff --git a/layouts/rss.xml b/layouts/rss.xml new file mode 100644 index 00000000..70b73407 --- /dev/null +++ b/layouts/rss.xml @@ -0,0 +1,27 @@ +{{- printf "" | safeHTML }} + + + {{ site.Title }} + {{ .Permalink }} + {{ site.Params.description }} + Hugo -- {{ hugo.Version }} + {{ site.Language.LanguageCode }} + {{site.Params.author.email}} ({{site.Params.author.name}}) + {{site.Params.author.email}} ({{site.Params.author.name}}) + {{ site.Copyright | markdownify | plainify | strings.TrimPrefix "© " }} + {{ site.Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + + {{- range .RegularPagesRecursive }} + + {{ .Title }} + {{ .Permalink }} + {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{site.Params.author.email}} ({{site.Params.author.name}}) + {{ .Permalink }} + {{ with .Description }} + {{ . }} + {{ end -}} + + {{- end }} + + -- 2.39.5