Filter for valid link rel values
This commit is contained in:
		| @@ -41,19 +41,22 @@ | ||||
| <rss version="2.0" {{ with $language }} xml:lang="{{ . }}" {{ end }} xmlns:atom="http://www.w3.org/2005/Atom"> | ||||
|     <channel> | ||||
|         {{ 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 }} | ||||
|                 <atom:link href="{{ .Permalink }}" hreflang="{{ .Language.LanguageCode }}" rel="{{ $rel }}" type="{{ .MediaType }}"/> | ||||
|             {{ 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 }} | ||||
|                     <atom:link href="{{ .Permalink }}" hreflang="{{ $t.Language.LanguageCode }}" rel="{{ .Rel }}" type="{{ .MediaType }}"/> | ||||
|                 {{ end }} | ||||
|             {{ end }} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user