diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index 192ece30..9178868d 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -65,19 +65,22 @@ {{ end }} {{ range $page.OutputFormats }} + {{ $kind := not (hasSuffix .Permalink "/paige-search.json") }} {{ $rel := cond (eq .Rel "canonical") "self" .Rel }} - {{ $suffix := hasSuffix .Permalink "/paige-search.json" }} - {{ if not $suffix }} + {{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") $rel }} + + {{ if and $kind $valid }} {{ end }} {{ end }} {{ range $t := $page.Translations }} {{ range .OutputFormats }} - {{ $suffix := hasSuffix .Permalink "/paige-search.json" }} + {{ $kind := not (hasSuffix .Permalink "/paige-search.json") }} + {{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") .Rel }} - {{ if not $suffix }} + {{ if and $kind $valid }} {{ end }} {{ end }} @@ -155,16 +158,25 @@ {{ end }} {{ range .OutputFormats }} + {{ $kind := not (hasSuffix .Permalink "/paige-search.json") }} {{ $rel := cond (eq .Rel "canonical") "self" .Rel }} {{ $href := cond (and (eq $rel "alternate") (eq .MediaType.Type "text/html")) $link .Permalink }} + {{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") $rel }} - + {{ if and $kind $valid }} + + {{ end }} {{ end }} {{ range $t := .Translations }} {{ range .OutputFormats }} - + {{ $kind := not (hasSuffix .Permalink "/paige-search.json") }} + {{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") .Rel }} + + {{ if and $kind $valid }} + + {{ end }} {{ end }} {{ end }} diff --git a/layouts/_default/list.rss.xml b/layouts/_default/list.rss.xml index 31c8ee4f..d7898bd6 100644 --- a/layouts/_default/list.rss.xml +++ b/layouts/_default/list.rss.xml @@ -41,19 +41,22 @@ {{ range $page.OutputFormats }} + {{ $kind := not (hasSuffix .Permalink "/paige-search.json") }} {{ $rel := cond (eq .Rel "canonical") "self" .Rel }} - {{ $suffix := hasSuffix .Permalink "/paige-search.json" }} - {{ if not $suffix }} + {{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") $rel }} + + {{ if and $kind $valid }} {{ end }} {{ end }} {{ range $t := $page.Translations }} {{ range .OutputFormats }} - {{ $suffix := hasSuffix .Permalink "/paige-search.json" }} + {{ $kind := not (hasSuffix .Permalink "/paige-search.json") }} + {{ $valid := in (slice "alternate" "enclosure" "related" "self" "via") .Rel }} - {{ if not $suffix }} + {{ if and $kind $valid }} {{ end }} {{ end }}