2021-06-21 14:10:15 +02:00
|
|
|
{{- $allowedRssSections := (slice "post") -}}
|
2020-11-24 21:29:44 +01:00
|
|
|
{{- $baseurl := .Site.BaseURL -}}
|
|
|
|
{{- $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 -}}
|
2022-04-27 17:25:53 +02:00
|
|
|
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n" | safeHTML }}
|
|
|
|
{{- printf "<?xml-stylesheet type=\"text/xsl\" media=\"screen\" href=\"%spretty-feed-v3.xsl\" ?>" $baseurl | safeHTML }}
|
2022-04-19 17:33:36 +02:00
|
|
|
<rss version='2.0' xmlns:content='http://purl.org/rss/1.0/modules/content/' xmlns:atom='http://www.w3.org/2005/Atom' xmlns:dc='http://purl.org/dc/elements/1.1/'>
|
2020-11-24 21:29:44 +01:00
|
|
|
<channel>
|
|
|
|
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
|
|
|
<link>{{ .Permalink }}</link>
|
2022-04-19 17:33:36 +02:00
|
|
|
<description>{{ .Site.Params.description }} by {{ .Site.Author.name }}</description>
|
2020-11-24 21:29:44 +01:00
|
|
|
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
2021-02-21 13:44:57 +01:00
|
|
|
<language>{{.}}</language>{{end}}
|
2022-04-19 17:33:36 +02:00
|
|
|
<managingEditor>{{ .Site.Author.rssmail }} ({{ with $.Site.Author.name }}{{.}}{{end}})</managingEditor>
|
|
|
|
{{ if not .Date.IsZero }}<lastBuildDate>{{ .Date.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 }}
|
|
|
|
<image>
|
2022-04-19 21:37:55 +02:00
|
|
|
<url>{{ $baseurl }}img/logo-rss.jpg</url>
|
2022-04-19 17:33:36 +02:00
|
|
|
<title>{{ .Site.Title }}</title>
|
|
|
|
<link>{{ .Permalink }}</link>
|
2022-04-19 21:37:55 +02:00
|
|
|
<width>72</width>
|
|
|
|
<height>72</height>
|
2022-04-19 17:33:36 +02:00
|
|
|
<description>{{ .Site.Params.description }} by {{ .Site.Author.name }}</description>
|
|
|
|
</image>
|
2020-11-24 21:29:44 +01:00
|
|
|
{{ range $pages }}
|
2021-05-20 15:23:30 +02:00
|
|
|
{{ if and (in $allowedRssSections .Section) (not (isset .Params "type")) (or (not (isset .Params "context")) (eq .Params.context "")) }}
|
2020-11-24 21:29:44 +01:00
|
|
|
<item>
|
2021-06-21 14:10:15 +02:00
|
|
|
<title>{{ .Title }}</title>
|
2020-11-24 21:29:44 +01:00
|
|
|
<link>{{ .Permalink }}</link>
|
2021-03-18 11:23:50 +01:00
|
|
|
<comments>{{ .Site.Author.mastodonlink }}</comments>
|
2020-11-24 21:29:44 +01:00
|
|
|
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
2022-04-19 17:33:36 +02:00
|
|
|
<dc:creator>{{ with $.Site.Author.name }}{{.}}{{end}}</dc:creator>
|
2021-02-21 13:44:57 +01:00
|
|
|
<guid isPermaLink="true">{{ .Permalink }}</guid>
|
2020-11-24 21:29:44 +01:00
|
|
|
{{ if .Keywords }}
|
|
|
|
{{ range .Keywords }}
|
|
|
|
<category>{{ . }}</category>
|
|
|
|
{{ end }}
|
|
|
|
{{ else if .Params.tags }}
|
|
|
|
{{ range .Params.tags }}
|
2021-02-21 13:44:57 +01:00
|
|
|
<category domain="{{ $baseurl }}tags/{{ . }}">{{ . }}</category>
|
2020-11-24 21:29:44 +01:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2021-01-05 15:30:06 +01:00
|
|
|
|
2021-07-10 20:15:14 +02:00
|
|
|
{{ $content := .Content }}
|
|
|
|
<!-- relative images/URLs do not work in some feed readers. Thanks, Peter. See render-image.html -->
|
|
|
|
{{ $content = replaceRE `<img src="../(.*?)"` (printf "%s%s%s" "<img src=\"" .Permalink "../$1\"") $content }}
|
2022-05-09 08:56:12 +02:00
|
|
|
{{ $content = replaceRE `<img src="/(.*?)"` (printf "%s%s%s" "<img src=\"" $baseurl "$1\"") $content }}
|
2021-07-10 20:15:14 +02:00
|
|
|
{{ $content = replaceRE `a href="(#.*?)"` (printf "%s%s%s" "a href=\"" .Permalink "$1\"") $content }}
|
|
|
|
{{ $content = replaceRE `a href="../(.*?)"` (printf "%s%s%s" "a href=\"" .Permalink "../$1\"") $content }}
|
2022-05-09 08:56:12 +02:00
|
|
|
{{ $content = replaceRE `a href="/(.*?)"` (printf "%s%s%s" "a href=\"" $baseurl "$1\"") $content }}
|
2020-11-24 21:29:44 +01:00
|
|
|
<description>
|
|
|
|
{{ `<![CDATA[ ` | safeHTML }}
|
|
|
|
{{ if .Params.bigimg }}
|
2021-01-05 15:30:06 +01:00
|
|
|
<p>
|
|
|
|
<img align="left" hspace="5" src="{{ $baseurl }}bigimg/{{ .Params.bigimg }}"/>
|
|
|
|
</p>
|
2020-11-24 21:29:44 +01:00
|
|
|
{{ end }}
|
|
|
|
|
2021-07-10 20:15:14 +02:00
|
|
|
{{ $content | safeHTML }}
|
2021-01-05 17:03:59 +01:00
|
|
|
|
|
|
|
<p>
|
2022-03-08 08:55:04 +01:00
|
|
|
By <a href="/about">{{ .Site.Author.name }}</a> on {{ .Date.Format "2 January 2006" }}.
|
2022-03-24 21:35:48 +01:00
|
|
|
<a href="mailto:{{ .Site.Author.rssmail }}?subject=Re: {{ .Title }}">Reply via email</a>.
|
2021-01-05 17:03:59 +01:00
|
|
|
</p>
|
2020-11-24 21:29:44 +01:00
|
|
|
]]>
|
|
|
|
</description>
|
|
|
|
</item>
|
|
|
|
{{ end }}
|
2021-03-19 20:43:23 +01:00
|
|
|
{{ end }}
|
2020-11-24 21:29:44 +01:00
|
|
|
</channel>
|
|
|
|
</rss>
|