diff options
-rw-r--r-- | themes/default/layouts/partials/base-discovery.html | 33 | ||||
-rw-r--r-- | themes/default/layouts/partials/base-head.html | 7 |
2 files changed, 34 insertions, 6 deletions
diff --git a/themes/default/layouts/partials/base-discovery.html b/themes/default/layouts/partials/base-discovery.html new file mode 100644 index 0000000..4370063 --- /dev/null +++ b/themes/default/layouts/partials/base-discovery.html @@ -0,0 +1,33 @@ +{{- partial "generate-authors" . -}} + +{{- + $authorData := (dict + "Context" . + "AuthorDefaultUser" .Site.Author.default.home + ) +-}} + +{{- $author := partial "function-authors-data.html" (dict "Data" $authorData) -}} + +<link + rel="alternate" + type="application/rss+xml" + title="{{ $author.name }}'s Feed" + href="{{ .Site.BaseURL }}/{{ $author.user }}/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 -}} diff --git a/themes/default/layouts/partials/base-head.html b/themes/default/layouts/partials/base-head.html index d01f61a..9f96bd4 100644 --- a/themes/default/layouts/partials/base-head.html +++ b/themes/default/layouts/partials/base-head.html @@ -51,12 +51,7 @@ <link rel="home" href="{{ .Site.BaseURL }}/{{ $author.user }}/" /> <!-- Feed Discovery --> -<link - rel="alternate" - type="application/rss+xml" - title="{{ $author.name }}'s Feed" - href="{{ .Site.BaseURL }}/{{ $author.user }}/rss.xml" -/> +{{- partial "base-discovery.html" . -}} <!-- Style Sheets & Scripts --> {{- $index := resources.Get "js/index.js" -}} |