From 4294f5bd05306f66fbb6f1fbf874283b02996824 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Tue, 4 Mar 2025 18:16:04 -0800 Subject: [PATCH] Qualify subpage dots in feeds --- layouts/_default/list.atom.xml | 28 ++++++++++++++-------------- layouts/_default/list.rss.xml | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index 91f3d291..bc387385 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -105,32 +105,32 @@ {{ end }} {{ range $subpage := $subpages }} - {{ if not (.Param "paige.exclude_feeds") }} + {{ if not ($subpage.Param "paige.exclude_feeds") }} {{ $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 }} - {{ $id := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host (.PublishDate.Format "2006-01-02") .RelPermalink }} - {{ $lastmod := .Lastmod.Format $date }} - {{ $published := .PublishDate.Format $date }} - {{ $title := .Title | markdownify | plainify | htmlUnescape }} + {{ $id := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host ($subpage.PublishDate.Format "2006-01-02") $subpage.RelPermalink }} + {{ $lastmod := $subpage.Lastmod.Format $date }} + {{ $published := $subpage.PublishDate.Format $date }} + {{ $title := $subpage.Title | markdownify | plainify | htmlUnescape }} - {{ $link := cond $external .Params.link .Permalink }} + {{ $link := cond $external $subpage.Params.link $subpage.Permalink }} {{ if and $content $external }} - {{ $text := or (.Param "paige.feeds.page_link" | markdownify) "⏎" }} + {{ $text := or ($subpage.Param "paige.feeds.page_link" | markdownify) "⏎" }} - {{ $footer := printf `

%s

` .Permalink $text | safeHTML }} + {{ $footer := printf `

%s

` $subpage.Permalink $text | safeHTML }} {{ $content = print $content $footer }} {{ end }} {{ if not $content }} - {{ $content = markdownify .Description }} + {{ $content = markdownify $subpage.Description }} {{ end }} - {{ $content = replaceRE `` (printf `` .Permalink) $content }} - {{ $content = replaceRE `` (printf `` .Permalink) $content }} + {{ $content = replaceRE `` (printf `` $subpage.Permalink) $content }} + {{ $content = replaceRE `` (printf `` $subpage.Permalink) $content }} {{ $content = partial "paige/func-minify.html" (dict "content" $content) }} {{ with partial "paige/func-authors.html" . }} @@ -159,7 +159,7 @@ {{ . }} {{ end }} - {{ range .OutputFormats }} + {{ range $subpage.OutputFormats }} {{ $rel := cond (eq .Rel "canonical") "alternate" .Rel }} {{ $href := cond (and (eq $rel "alternate") (eq .MediaType.Type "text/html")) $link .Permalink }} @@ -170,7 +170,7 @@ {{ end }} {{ end }} - {{ range $t := .Translations }} + {{ range $t := $subpage.Translations }} {{ range .OutputFormats }} {{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") .Rel }} diff --git a/layouts/_default/list.rss.xml b/layouts/_default/list.rss.xml index 70aa6819..269ca7af 100644 --- a/layouts/_default/list.rss.xml +++ b/layouts/_default/list.rss.xml @@ -93,17 +93,17 @@ {{ end }} {{ range $subpage := $subpages }} - {{ if not (.Param "paige.exclude_feeds") }} + {{ if not ($subpage.Param "paige.exclude_feeds") }} {{ $author := "" }} - {{ $authors := partial "paige/func-authors.html" . }} + {{ $authors := partial "paige/func-authors.html" $subpage }} {{ $content := partial "paige/func-content.html" $subpage }} - {{ $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 }} + {{ $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 ($subpage.PublishDate.Format "2006-01-02") (cond ($subpage.Params.id | not) $subpage.RelPermalink $subpage.Params.id) }} + {{ $published := $subpage.PublishDate.Format $date }} + {{ $title := $subpage.Title | markdownify | plainify | htmlUnescape }} - {{ $link := cond $external .Params.link .Permalink }} + {{ $link := cond $external $subpage.Params.link $subpage.Permalink }} {{ with $authors }} {{ $primary := index . 0 }} @@ -116,19 +116,19 @@ {{ end }} {{ if and $content $external }} - {{ $text := or (.Param "paige.feeds.page_link" | markdownify) "⏎" }} + {{ $text := or ($subpage.Param "paige.feeds.page_link" | markdownify) "⏎" }} - {{ $footer := printf `

%s

` .Permalink $text | safeHTML }} + {{ $footer := printf `

%s

` $subpage.Permalink $text | safeHTML }} {{ $content = print $content $footer }} {{ end }} {{ if not $content }} - {{ $content = .Description | markdownify }} + {{ $content = $subpage.Description | markdownify }} {{ end }} - {{ $content = replaceRE `` (printf `` .Permalink) $content }} - {{ $content = replaceRE `` (printf `` .Permalink) $content }} + {{ $content = replaceRE `` (printf `` $subpage.Permalink) $content }} + {{ $content = replaceRE `` (printf `` $subpage.Permalink) $content }} {{ $content = partial "paige/func-minify.html" (dict "content" $content) }} {{ with $author }} @@ -147,7 +147,7 @@ {{ . }} {{ end }} - {{ range .OutputFormats }} + {{ range $subpage.OutputFormats }} {{ $rel := cond (eq .Rel "canonical") "alternate" .Rel }} {{ $href := cond (and (eq $rel "alternate") (eq .MediaType.Type "text/html")) $link .Permalink }} @@ -158,7 +158,7 @@ {{ end }} {{ end }} - {{ range $t := .Translations }} + {{ range $t := $subpage.Translations }} {{ range .OutputFormats }} {{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") .Rel }}