]> juplo.de Git - website/commitdiff
WIP frontend--hugo--rebase--2025-12-21--18-30
authorKai Moritz <kai@juplo.de>
Sat, 20 Dec 2025 22:28:42 +0000 (23:28 +0100)
committerKai Moritz <kai@juplo.de>
Sat, 20 Dec 2025 22:28:42 +0000 (23:28 +0100)
hugo.yaml
layouts/rss.xml

index aacde1e6b7411f8453e7f2189d4c0b13336a16f7..bdd51f41a462d98b4090f9400854a65d13186d6e 100644 (file)
--- a/hugo.yaml
+++ b/hugo.yaml
@@ -1,5 +1,5 @@
 baseURL: https://example.org/
-copyright: mo
+copyright: Kai Moritz
 languageCode: en-US
 mainSections:
   - blog
@@ -11,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
index 06c639bd3c652a3859741d1f932010dead3253bc..70b73407fcdea4de6ecd553b93ddee3e59e30f3d 100644 (file)
@@ -1,44 +1,27 @@
-{{- $pctx := . }}
-{{- if .IsHome }}{{ $pctx = site }}{{ end }}
-{{- $pages := slice }}
-{{- if or $.IsHome $.IsSection }}
-{{- $pages = $pctx.RegularPages }}
-{{- else }}
-{{- $pages = $pctx.Pages }}
-{{- end }}
-{{- $limit := site.Config.Services.RSS.Limit }}
-{{- if ge $limit 1 }}
-{{- $pages = $pages | first $limit }}
-{{- end }}
 {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
   <channel>
     <title>{{ site.Title }}</title>
     <link>{{ .Permalink }}</link>
-    <description>{{ site.Description }}</description>
+    <description>{{ site.Params.description }}</description>
     <generator>Hugo -- {{ hugo.Version }}</generator>
     <language>{{ site.Language.LanguageCode }}</language>
-    <managingEditor>{{params.author.email}} ({{params.author.name}})</managingEditor>
-    <webMaster>{{params.author.email}} ({{params.author.name}})</webMaster>
-    <copyright>{{ . | markdownify | plainify | strings.TrimPrefix "© " }}</copyright>
-    <lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
-    {{- with .OutputFormats.Get "RSS" }}
-    {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
-    {{- end }}
-    {{- range $pages }}
-    {{- if and (ne .Layout `search`) (ne .Layout `archives`) }}
+    <managingEditor>{{site.Params.author.email}} ({{site.Params.author.name}})</managingEditor>
+    <webMaster>{{site.Params.author.email}} ({{site.Params.author.name}})</webMaster>
+    <copyright>{{ site.Copyright | markdownify | plainify | strings.TrimPrefix "© " }}</copyright>
+    <lastBuildDate>{{ site.Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
+    <atom:link href="{{ .Permalink }}" rel="self" type="rss" />
+    {{- range .RegularPagesRecursive }}
     <item>
       <title>{{ .Title }}</title>
       <link>{{ .Permalink }}</link>
       <pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
-      {{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
+      <author>{{site.Params.author.email}} ({{site.Params.author.name}})</author>
       <guid>{{ .Permalink }}</guid>
-      <description>{{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}}</description>
-      {{- if and site.Params.ShowFullTextinRSS .Content }}
-      <content:encoded>{{ (printf "<![CDATA[%s]]>" .Content) | safeHTML }}</content:encoded>
-      {{- end }}
+      {{ with .Description }}
+      <description>{{ . }}</description>
+      {{ end -}}
     </item>
     {{- end }}
-    {{- end }}
   </channel>
 </rss>