From 8758f3622c22bc267c1e6ea21cb8621d453d0382 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Duje=20Mihanovi=C4=87?= Date: Sat, 16 Sep 2023 13:56:52 +0200 Subject: [PATCH] Switch to Atom feed --- layouts/rss.xml | 63 ++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/layouts/rss.xml b/layouts/rss.xml index 18d4ff6..b43900f 100644 --- a/layouts/rss.xml +++ b/layouts/rss.xml @@ -1,29 +1,34 @@ -{{- printf "" | safeHTML }} - - - {{ .Site.Title }} - {{ .Permalink }} - Recent content on {{ .Site.Title }} - Hugo -- gohugo.io - {{ site.Language.LanguageCode }}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} - {{.}}{{end}}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} - {{- with .OutputFormats.Get "RSS" -}} - {{ printf "" .Permalink .MediaType | safeHTML }} - {{- end -}} - {{ with .Site.GetPage "posts/" }} - {{ range .Pages | first .Site.Config.Services.RSS.Limit }} - - {{ .Title }} - {{ .Permalink }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} - {{ .Permalink }} - {{ .Content | html }} - - {{ end }} - {{ end }} - - +{{- printf "" | safeHTML }} + + {{ .Site.Title }} + {{ .Permalink }} + {{ $lastmod := 0 }} + {{ range (.Site.GetPage "/posts").Pages }} + {{ if gt .Lastmod $lastmod }} + {{ $lastmod = .Lastmod }} + {{ end }} + {{ end }} + {{ $lastmod.Format "2006-01-02T15:04:05Z" }} + + + + {{ $.Site.Author.name }} + {{ $.Site.Author.email }} + {{ .Permalink }} + + Hugo + + {{ with $.Site.GetPage "posts/" }} + {{ range first .Site.Config.Services.RSS.Limit .Pages }} + + {{ .Permalink }} + + {{ .Title }} + {{ .Lastmod.Format "2006-01-02T15:04:05Z" }} + {{ .PublishDate.Format "2006-01-02T15:04:05Z" }} + {{ .Content | html }} + {{ .Summary | html }} + + {{ end }} + {{ end }} + -- 2.39.5