brainbaking/themes/brainbaking-minimal/layouts/all/list.xml

45 lines
2.0 KiB
XML

{{- $baseurl := .Site.BaseURL -}}
{{- $pages := .Site.RegularPages -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version='2.0' xmlns:content='http://purl.org/rss/1.0/modules/content/' xmlns:atom='http://www.w3.org/2005/Atom'>
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}
<managingEditor>{{ with $.Site.Author.name }}{{.}}{{end}}</managingEditor>
<webMaster>{{ with $.Site.Author.name }}{{.}}{{end}}</webMaster>{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ 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 }}
{{ range $pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<comments>{{ .Site.Author.mastodonlink }}</comments>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<author>{{ with $.Site.Author.name }}{{.}}{{end}}</author>
<guid isPermaLink="true">{{ .Permalink }}</guid>
{{ if .Keywords }}
{{ range .Keywords }}
<category>{{ . }}</category>
{{ end }}
{{ else if .Params.tags }}
{{ range .Params.tags }}
<category domain="{{ $baseurl }}tags/{{ . }}">{{ . }}</category>
{{ end }}
{{ end }}
{{ $content := .Content | safeHTML }}
<description>
{{ `<![CDATA[ ` | safeHTML }}
{{ $content }}
]]>
</description>
</item>
{{ end }}
</channel>
</rss>