diff options
author | tdro <tdro@noreply.example.com> | 2022-12-04 16:39:35 -0500 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-12-04 16:39:35 -0500 |
commit | 848f6a7f9dc8db283766e657c19aa7d2bfecfb2a (patch) | |
tree | 261e770eee51f9d0547cd82ed058ea1afe9b23a8 /themes | |
parent | 76e6137d4a1984bd24402ae0a917df8c09299bd5 (diff) | |
download | canory-848f6a7f9dc8db283766e657c19aa7d2bfecfb2a.tar.gz canory-848f6a7f9dc8db283766e657c19aa7d2bfecfb2a.tar.bz2 canory-848f6a7f9dc8db283766e657c19aa7d2bfecfb2a.zip |
themes/default/layouts/partials/base-head: Increase discovery
By linking followed feeds
Diffstat (limited to 'themes')
-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" -}} |