mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2026-05-03 07:04:47 +00:00
Templated RSS feature to include special postroll rules
This commit is contained in:
parent
6f8ae91e56
commit
47c3dcfc5d
3 changed files with 18 additions and 63 deletions
|
|
@ -29,18 +29,12 @@
|
|||
{{ 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>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Params.email }}<author>{{.}}{{ with $.Site.Params.Author }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
{{ printf `<description><![CDATA[%s]]></description>` .Summary | safeHTML }}
|
||||
{{ printf `<content:encoded><![CDATA[%s]]></content:encoded>` .Content | safeHTML }}
|
||||
{{ range .Param "tags" }}<category>{{ . }}</category>
|
||||
{{ end }}
|
||||
</item>
|
||||
{{ end }}
|
||||
{{ range $pages }}
|
||||
{{ $itemPartial := printf "rss-item/%s.xml" .Type }}
|
||||
{{- if not (templates.Exists (printf "partials/%s" $itemPartial)) -}}
|
||||
{{- $itemPartial = "rss-item/default.xml" -}}
|
||||
{{- end -}}
|
||||
{{ partial $itemPartial . }}
|
||||
{{ end }}
|
||||
</channel>
|
||||
</rss>
|
||||
Loading…
Add table
Add a link
Reference in a new issue