Add relation tags for syndication

This commit is contained in:
JP Hastings-Spital 2023-11-01 08:23:03 +00:00
parent 111f2e7a53
commit 7b195b80c8

View file

@ -10,7 +10,7 @@
{{- end -}} {{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
{{- printf "<?xml-stylesheet href=\"/rss.xsl\" type=\"text/xsl\"?>" | safeHTML }} {{- printf "<?xml-stylesheet href=\"/rss.xsl\" type=\"text/xsl\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel> <channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink | absURL }}</link> <link>{{ .Permalink | absURL }}</link>
@ -30,20 +30,22 @@
<link>{{ .Permalink | absURL }}</link> <link>{{ .Permalink | absURL }}</link>
{{ if .Page.Params.Audio }}<enclosure url="{{ .Permalink | absURL }}{{ .Page.Params.Audio }}" length="{{ (os.Stat (path.Join .File.Dir .Page.Params.Audio)).Size }}" type="audio/mpeg" />{{end}} {{ if .Page.Params.Audio }}<enclosure url="{{ .Permalink | absURL }}{{ .Page.Params.Audio }}" length="{{ (os.Stat (path.Join .File.Dir .Page.Params.Audio)).Size }}" type="audio/mpeg" />{{end}}
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink | absURL }}</guid> <guid>{{ .Permalink | absURL }}</guid>
<description> <description>
{{- with index .Params.Media 0 }} {{- with index .Params.Media 0 }}
<img src="{{ path.Join $page.RelPermalink . | absURL }}" /> &lt;img src="{{ path.Join $page.RelPermalink . | absURL }}" /&gt;
{{ end -}} {{- end }}
{{- .Summary -}} {{ .Summary | html }}
</description> </description>
<content:encoded> <content:encoded>
{{- range $i, $src := .Params.Media }} {{- range $i, $src := .Params.Media }}
<img src="{{ path.Join $page.RelPermalink $src | absURL }}" /> &lt;img src="{{ path.Join $page.RelPermalink $src | absURL }}" /&gt;&lt;br/&gt;
{{ end -}} {{- end }}
{{- .Content | html -}} {{ .Content | html }}
</content:encoded> </content:encoded>
{{- range .Params.syndications}}
<dc:relation>{{ . }}</dc:relation>
{{- end }}
</item> </item>
{{ end }} {{ end }}
</channel> </channel>