You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
160 lines
6.0 KiB
XML
160 lines
6.0 KiB
XML
{{ $page := . }}
|
|
|
|
{{ $copyright := site.Copyright | markdownify | plainify | htmlUnescape }}
|
|
{{ $date := "Mon, 02 Jan 2006 15:04:05 MST" }}
|
|
{{ $description := cond $page.IsHome ($page.Param "paige.site.description") $page.Description | markdownify | plainify | htmlUnescape }}
|
|
{{ $editor := $page.Param "paige.feeds.rss.managing_editor" }}
|
|
{{ $language := site.LanguageCode }}
|
|
{{ $limit := site.Config.Services.RSS.Limit }}
|
|
{{ $link := ($page.AlternativeOutputFormats.Get "html").Permalink }}
|
|
{{ $master := $page.Param "paige.feeds.rss.web_master" }}
|
|
{{ $subpages := $page.RegularPagesRecursive.ByPublishDate }}
|
|
|
|
{{ $lastmod := site.Lastmod.Format $date }}
|
|
|
|
{{ if gt $limit 0 }}
|
|
{{ $subpages = $subpages | first $limit }}
|
|
{{ end }}
|
|
|
|
{{ $titles := slice }}
|
|
|
|
{{ if $page.IsHome }}
|
|
{{ $titles = slice (site.Title | default $page.Title | markdownify | plainify | htmlUnescape) }}
|
|
{{ else }}
|
|
{{ with $page.Title }}
|
|
{{ $titles = slice (. | markdownify | plainify | htmlUnescape) }}
|
|
{{ end }}
|
|
|
|
{{ range .Ancestors }}
|
|
{{ $title := cond .IsHome (site.Title | default .Title) .Title }}
|
|
|
|
{{ with $title }}
|
|
{{ $titles = $titles | append (. | markdownify | plainify | htmlUnescape) }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ $title := delimit $titles " · " }}
|
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<rss version="2.0" {{ with $language }} xml:lang="{{ . }}" {{ end }} xmlns:atom="http://www.w3.org/2005/Atom">
|
|
<channel>
|
|
{{ range $page.OutputFormats }}
|
|
{{ $rel := cond (eq .Rel "canonical") "self" .Rel }}
|
|
{{ $suffix := hasSuffix .Permalink "/paige-search.json" }}
|
|
|
|
{{ if not $suffix }}
|
|
<link href="{{ .Permalink }}" hreflang="{{ .Language.LanguageCode }}" rel="{{ $rel }}" type="{{ .MediaType }}"/>
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ range $t := $page.Translations }}
|
|
{{ range .OutputFormats }}
|
|
{{ $suffix := hasSuffix .Permalink "/paige-search.json" }}
|
|
|
|
{{ if not $suffix }}
|
|
<link href="{{ .Permalink }}" hreflang="{{ $t.Language.LanguageCode }}" rel="{{ .Rel }}" type="{{ .MediaType }}"/>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ with $copyright }}
|
|
<copyright>{{ . }}</copyright>
|
|
{{ end }}
|
|
|
|
{{ with $description }}
|
|
<description>{{ . }}</description>
|
|
{{ end }}
|
|
|
|
{{ with $language }}
|
|
<language>{{ . }}</language>
|
|
{{ end }}
|
|
|
|
{{ with $lastmod }}
|
|
<lastBuildDate>{{ . }}</lastBuildDate>
|
|
{{ end }}
|
|
|
|
{{ with $link }}
|
|
<link>{{ . }}</link>
|
|
{{ end }}
|
|
|
|
{{ with $editor }}
|
|
<managingEditor>{{ . }}</managingEditor>
|
|
{{ end }}
|
|
|
|
{{ with $title }}
|
|
<title>{{ . }}</title>
|
|
{{ end }}
|
|
|
|
{{ with $master }}
|
|
<webMaster>{{ . }}</webMaster>
|
|
{{ end }}
|
|
|
|
{{ range $subpages }}
|
|
{{ if not (.Param "paige.exclude_feeds") }}
|
|
<item>
|
|
{{ $author := "" }}
|
|
{{ $authors := partial "paige/func-authors.html" . }}
|
|
{{ $description := .Content }}
|
|
{{ $external := and .Params.link (not (.Param "paige.feeds.disable_link")) | not | not }}
|
|
{{ $guid := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host (.PublishDate.Format "2006-01-02") (cond (.Params.id | not) .RelPermalink .Params.id) }}
|
|
{{ $published := .PublishDate.Format $date }}
|
|
{{ $title := .Title | markdownify | plainify | htmlUnescape }}
|
|
|
|
{{ $link := cond $external .Params.link .Permalink }}
|
|
|
|
{{ with $authors }}
|
|
{{ $primary := index . 0 }}
|
|
|
|
{{ if and $primary.Params.paige.author.email $primary.Params.paige.author.name }}
|
|
{{ $author = printf "%s (%s)" $primary.Params.paige.author.email ($primary.Params.paige.author.name | default ($primary.Title | markdownify | plainify | htmlUnescape)) }}
|
|
{{ else if $primary.Params.email }}
|
|
{{ $author = $primary.Params.email }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if and $description $external }}
|
|
{{ $text := or (.Param "paige.feeds.page_link" | markdownify) "⏎" }}
|
|
|
|
{{ $footer := printf `<p><a href="%s" title="%s">%s</a></p>` .Permalink (htmlEscape $title) $text | safeHTML }}
|
|
|
|
{{ $description = print $description $footer }}
|
|
{{ end }}
|
|
|
|
{{ if not $description }}
|
|
{{ $description = .Description | markdownify }}
|
|
{{ end }}
|
|
|
|
{{ $description = replaceRE `<a href="#fn:(\d+)" class="footnote-ref" role="doc-noteref">` (printf `<a href="%s#fn:$1" class="footnote-ref" role="doc-noteref">` .Permalink) $description }}
|
|
{{ $description = replaceRE `<a href="#fnref:(\d+)" class="footnote-backref" role="doc-backlink">` (printf `<a href="%s#fnref:$1" class="footnote-backref" role="doc-backlink">` .Permalink) $description }}
|
|
|
|
{{ with $author }}
|
|
<author>{{ . }}</author>
|
|
{{ end }}
|
|
|
|
{{ with $description }}
|
|
<description><![CDATA[{{ . }}]]></description>
|
|
{{ end }}
|
|
|
|
{{ with $guid }}
|
|
<guid isPermaLink="false">{{ . }}</guid>
|
|
{{ end }}
|
|
|
|
{{ with $link }}
|
|
<link>{{ . }}</link>
|
|
{{ end }}
|
|
|
|
{{ with $published }}
|
|
<pubDate>{{ . }}</pubDate>
|
|
{{ end }}
|
|
|
|
{{ with $title }}
|
|
<title>{{ . }}</title>
|
|
{{ end }}
|
|
</item>
|
|
{{ end }}
|
|
{{ end }}
|
|
</channel>
|
|
</rss>
|