diff options
author | tdro <tdro@noreply.example.com> | 2022-05-03 04:25:49 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-05-03 04:25:49 -0400 |
commit | e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6 (patch) | |
tree | 3667043819ab91065019dfe3b4ff83ad625c2b49 /themes/default/layouts/_default/rss.xml | |
download | canory-e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6.tar.gz canory-e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6.tar.bz2 canory-e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6.zip |
config.yaml: Commission
Diffstat (limited to 'themes/default/layouts/_default/rss.xml')
-rw-r--r-- | themes/default/layouts/_default/rss.xml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/themes/default/layouts/_default/rss.xml b/themes/default/layouts/_default/rss.xml new file mode 100644 index 0000000..4570a98 --- /dev/null +++ b/themes/default/layouts/_default/rss.xml @@ -0,0 +1,32 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := $pctx.RegularPages -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ partial "site-title" . }}</title> + <link>{{ .Permalink }}</link> + <description>Recent from {{ partial "site-title" . }}</description> + <language>{{ .Site.LanguageCode }}</language> + {{- 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 "application/rss+xml" | safeHTML -}} + {{ end }} + {{- range $pages -}} + {{ if and (ne .Params.hidden true) (not .Params.Unlisted) (not .ExpiryDate) }} + <item> + <title>{{ htmlEscape .Summary }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + <guid>{{ .Permalink }}</guid> + <description>{{ .Content | html }}</description> + </item> + {{ end }} + {{ end }} + </channel> +</rss> |