From 1867dc34c3f94b64580ab0b088012954807bfced Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Tue, 17 May 2022 15:46:41 +0200 Subject: Add RSS 2.0 support --- layouts/_default/home.feed.xml | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 layouts/_default/home.feed.xml (limited to 'layouts/_default/home.feed.xml') diff --git a/layouts/_default/home.feed.xml b/layouts/_default/home.feed.xml new file mode 100644 index 0000000..2f33114 --- /dev/null +++ b/layouts/_default/home.feed.xml @@ -0,0 +1,44 @@ +{{ safeHTML "" }} + + + {{ printf `<![CDATA[%s RSS]]>` site.Title | safeHTML }} + + {{ "/" | absURL }} + {{ $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png" ) }}{{ $logo = $logo.Resize "96x96" }} + + {{ $logo.Permalink | absURL }} + {{ printf `<![CDATA[%s RSS]]>` site.Title | safeHTML }} + {{ "/" | absURL }} + {{ $logo.Width }} + {{ $logo.Height }} + + + {{ with site.Home.OutputFormats.Get "FEED"}}{{end}} + {{ with site.Home.OutputFormats.Get "ATOM"}}{{end}} + {{ with site.Params.description }}{{ printf `` . | safeHTML }}{{ end }} + Hugo + {{ with site.Author.name }}{{ printf `` . | safeHTML }}{{ end }} + {{ with site.LanguageCode }}{{ . }}{{ end }} + {{ with site.Params.Copyright }}{{ printf `` . | safeHTML }}{{ end }} + {{ if not site.LastChange.IsZero }}{{ site.LastChange.UTC.Format site.Params.dateFormatRFC822Z | html }}{{ end }} + {{ $feedsize := site.Params.feedSize | default 25 }} + {{- range first $feedsize (where site.RegularPages.ByDate.Reverse "Type" "in" site.Params.mainSections) }} + + {{ printf `<![CDATA[%s]]>` .Title | safeHTML }} + {{ .Permalink | absURL }}{{ $date := .PublishDate.UTC }} + {{ $date.Format site.Params.dateFormatRFC822Z | html }} + {{ .Section }} + {{ range (.GetTerms "tags") }}{{ .LinkTitle }}{{end}} + {{ md5 .Permalink }} + {{ printf `` .Summary | safeHTML }} + + {{ end }} + -- cgit v1.2.3