Qualify subpage dots in feeds

master
Will Faught 4 months ago
parent 6d7fe50a72
commit 4294f5bd05

@ -105,32 +105,32 @@
{{ end }} {{ end }}
{{ range $subpage := $subpages }} {{ range $subpage := $subpages }}
{{ if not (.Param "paige.exclude_feeds") }} {{ if not ($subpage.Param "paige.exclude_feeds") }}
<entry> <entry>
{{ $content := partial "paige/func-content.html" $subpage }} {{ $content := partial "paige/func-content.html" $subpage }}
{{ $description := markdownify .Description }} {{ $description := markdownify $subpage.Description }}
{{ $external := and .Params.link (not (.Param "paige.feeds.disable_link")) | not | not }} {{ $external := and .Params.link (not (.Param "paige.feeds.disable_link")) | not | not }}
{{ $id := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host (.PublishDate.Format "2006-01-02") .RelPermalink }} {{ $id := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host ($subpage.PublishDate.Format "2006-01-02") $subpage.RelPermalink }}
{{ $lastmod := .Lastmod.Format $date }} {{ $lastmod := $subpage.Lastmod.Format $date }}
{{ $published := .PublishDate.Format $date }} {{ $published := $subpage.PublishDate.Format $date }}
{{ $title := .Title | markdownify | plainify | htmlUnescape }} {{ $title := $subpage.Title | markdownify | plainify | htmlUnescape }}
{{ $link := cond $external .Params.link .Permalink }} {{ $link := cond $external $subpage.Params.link $subpage.Permalink }}
{{ if and $content $external }} {{ if and $content $external }}
{{ $text := or (.Param "paige.feeds.page_link" | markdownify) "⏎" }} {{ $text := or ($subpage.Param "paige.feeds.page_link" | markdownify) "⏎" }}
{{ $footer := printf `<p><a href="%s">%s</a></p>` .Permalink $text | safeHTML }} {{ $footer := printf `<p><a href="%s">%s</a></p>` $subpage.Permalink $text | safeHTML }}
{{ $content = print $content $footer }} {{ $content = print $content $footer }}
{{ end }} {{ end }}
{{ if not $content }} {{ if not $content }}
{{ $content = markdownify .Description }} {{ $content = markdownify $subpage.Description }}
{{ end }} {{ end }}
{{ $content = replaceRE `<a href="#fn:(\d+)" class="footnote-ref" role="doc-noteref">` (printf `<a href="%s#fn:$1" class="footnote-ref" role="doc-noteref">` .Permalink) $content }} {{ $content = replaceRE `<a href="#fn:(\d+)" class="footnote-ref" role="doc-noteref">` (printf `<a href="%s#fn:$1" class="footnote-ref" role="doc-noteref">` $subpage.Permalink) $content }}
{{ $content = replaceRE `<a href="#fnref:(\d+)" class="footnote-backref" role="doc-backlink">` (printf `<a href="%s#fnref:$1" class="footnote-backref" role="doc-backlink">` .Permalink) $content }} {{ $content = replaceRE `<a href="#fnref:(\d+)" class="footnote-backref" role="doc-backlink">` (printf `<a href="%s#fnref:$1" class="footnote-backref" role="doc-backlink">` $subpage.Permalink) $content }}
{{ $content = partial "paige/func-minify.html" (dict "content" $content) }} {{ $content = partial "paige/func-minify.html" (dict "content" $content) }}
{{ with partial "paige/func-authors.html" . }} {{ with partial "paige/func-authors.html" . }}
@ -159,7 +159,7 @@
<id>{{ . }}</id> <id>{{ . }}</id>
{{ end }} {{ end }}
{{ range .OutputFormats }} {{ range $subpage.OutputFormats }}
{{ $rel := cond (eq .Rel "canonical") "alternate" .Rel }} {{ $rel := cond (eq .Rel "canonical") "alternate" .Rel }}
{{ $href := cond (and (eq $rel "alternate") (eq .MediaType.Type "text/html")) $link .Permalink }} {{ $href := cond (and (eq $rel "alternate") (eq .MediaType.Type "text/html")) $link .Permalink }}
@ -170,7 +170,7 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ range $t := .Translations }} {{ range $t := $subpage.Translations }}
{{ range .OutputFormats }} {{ range .OutputFormats }}
{{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") .Rel }} {{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") .Rel }}

@ -93,17 +93,17 @@
{{ end }} {{ end }}
{{ range $subpage := $subpages }} {{ range $subpage := $subpages }}
{{ if not (.Param "paige.exclude_feeds") }} {{ if not ($subpage.Param "paige.exclude_feeds") }}
<item> <item>
{{ $author := "" }} {{ $author := "" }}
{{ $authors := partial "paige/func-authors.html" . }} {{ $authors := partial "paige/func-authors.html" $subpage }}
{{ $content := partial "paige/func-content.html" $subpage }} {{ $content := partial "paige/func-content.html" $subpage }}
{{ $external := and .Params.link (not (.Param "paige.feeds.disable_link")) | not | not }} {{ $external := and $subpage.Params.link (not ($subpage.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) }} {{ $guid := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host ($subpage.PublishDate.Format "2006-01-02") (cond ($subpage.Params.id | not) $subpage.RelPermalink $subpage.Params.id) }}
{{ $published := .PublishDate.Format $date }} {{ $published := $subpage.PublishDate.Format $date }}
{{ $title := .Title | markdownify | plainify | htmlUnescape }} {{ $title := $subpage.Title | markdownify | plainify | htmlUnescape }}
{{ $link := cond $external .Params.link .Permalink }} {{ $link := cond $external $subpage.Params.link $subpage.Permalink }}
{{ with $authors }} {{ with $authors }}
{{ $primary := index . 0 }} {{ $primary := index . 0 }}
@ -116,19 +116,19 @@
{{ end }} {{ end }}
{{ if and $content $external }} {{ if and $content $external }}
{{ $text := or (.Param "paige.feeds.page_link" | markdownify) "⏎" }} {{ $text := or ($subpage.Param "paige.feeds.page_link" | markdownify) "⏎" }}
{{ $footer := printf `<p><a href="%s">%s</a></p>` .Permalink $text | safeHTML }} {{ $footer := printf `<p><a href="%s">%s</a></p>` $subpage.Permalink $text | safeHTML }}
{{ $content = print $content $footer }} {{ $content = print $content $footer }}
{{ end }} {{ end }}
{{ if not $content }} {{ if not $content }}
{{ $content = .Description | markdownify }} {{ $content = $subpage.Description | markdownify }}
{{ end }} {{ end }}
{{ $content = replaceRE `<a href="#fn:(\d+)" class="footnote-ref" role="doc-noteref">` (printf `<a href="%s#fn:$1" class="footnote-ref" role="doc-noteref">` .Permalink) $content }} {{ $content = replaceRE `<a href="#fn:(\d+)" class="footnote-ref" role="doc-noteref">` (printf `<a href="%s#fn:$1" class="footnote-ref" role="doc-noteref">` $subpage.Permalink) $content }}
{{ $content = replaceRE `<a href="#fnref:(\d+)" class="footnote-backref" role="doc-backlink">` (printf `<a href="%s#fnref:$1" class="footnote-backref" role="doc-backlink">` .Permalink) $content }} {{ $content = replaceRE `<a href="#fnref:(\d+)" class="footnote-backref" role="doc-backlink">` (printf `<a href="%s#fnref:$1" class="footnote-backref" role="doc-backlink">` $subpage.Permalink) $content }}
{{ $content = partial "paige/func-minify.html" (dict "content" $content) }} {{ $content = partial "paige/func-minify.html" (dict "content" $content) }}
{{ with $author }} {{ with $author }}
@ -147,7 +147,7 @@
<link>{{ . }}</link> <link>{{ . }}</link>
{{ end }} {{ end }}
{{ range .OutputFormats }} {{ range $subpage.OutputFormats }}
{{ $rel := cond (eq .Rel "canonical") "alternate" .Rel }} {{ $rel := cond (eq .Rel "canonical") "alternate" .Rel }}
{{ $href := cond (and (eq $rel "alternate") (eq .MediaType.Type "text/html")) $link .Permalink }} {{ $href := cond (and (eq $rel "alternate") (eq .MediaType.Type "text/html")) $link .Permalink }}
@ -158,7 +158,7 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ range $t := .Translations }} {{ range $t := $subpage.Translations }}
{{ range .OutputFormats }} {{ range .OutputFormats }}
{{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") .Rel }} {{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") .Rel }}

Loading…
Cancel
Save