diff options
Diffstat (limited to 'themes/default/layouts/partials/head-discovery.html')
-rw-r--r-- | themes/default/layouts/partials/head-discovery.html | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/themes/default/layouts/partials/head-discovery.html b/themes/default/layouts/partials/head-discovery.html new file mode 100644 index 0000000..8c7272f --- /dev/null +++ b/themes/default/layouts/partials/head-discovery.html @@ -0,0 +1,62 @@ +{{- $author := partial "function-authors-data.html" . -}} + +{{- with (eq .Page.Kind "home") -}} +<link + rel="alternate" + type="application/rss+xml" + title="{{ $.Site.Title }} Feed" + href="{{ "" | absURL }}/rss.xml" +/> + + {{- range $author := $.Site.Sections }} + <link + rel="alternate" + type="application/rss+xml" + title="{{ $author.Page.Type }}'s Feed" + href="{{ print $author.Permalink "rss.xml" | absURL }}" + /> + {{ end }} +{{- end -}} + +{{- with (eq .Page.Kind "section") -}} +<link + rel="alternate" + type="application/rss+xml" + title="{{ $author.name }}'s Feed" + href="{{ print ("" | absURL) "/" $.Section }}/rss.xml" +/> + +{{- with $author.feeds.rss }} + {{ range $author.feeds.rss }} + {{ $data := split . " " }} + {{- $url := delimit (first 1 $data) "" -}} + {{- $retitle := trim (delimit (after 1 $data) " ") " " -}} + {{- $retitle := and $retitle (print $retitle "'s Feed") -}} + + <link + rel="alternate" + type="application/rss+xml" + title="{{ or $retitle $url }}" + href="{{ $url }}" + /> + {{ end }} +{{ end }} +{{- end -}} + +{{- with (eq .Page.Kind "taxonomy") -}} +<link + rel="alternate" + type="application/rss+xml" + title="{{ $.Title }} Feed" + href="{{ $.Permalink }}rss.xml" +/> +{{- end -}} + +{{- with (eq .Page.Kind "term") -}} +<link + rel="alternate" + type="application/rss+xml" + title="#{{ lower $.Title }} Tag Feed" + href="{{ $.Permalink }}rss.xml" +/> +{{- end }} |