diff options
author | tdro <tdro@noreply.example.com> | 2022-08-10 01:06:01 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-08-10 01:06:01 -0400 |
commit | a2753213c7a392e3f5d937c67580c356f29d71ba (patch) | |
tree | 9d42c2e1261e2698f0e628017dc856e58a77df7c /themes/default/layouts/partials/following-list.html | |
parent | 8fff15f984b7d0b9a93c2ac4ef7b8a38230e7454 (diff) | |
download | canory-a2753213c7a392e3f5d937c67580c356f29d71ba.tar.gz canory-a2753213c7a392e3f5d937c67580c356f29d71ba.tar.bz2 canory-a2753213c7a392e3f5d937c67580c356f29d71ba.zip |
themes/default/layouts/partials/generate-feeds: Try to resolve home links
Carefully..
Diffstat (limited to 'themes/default/layouts/partials/following-list.html')
-rw-r--r-- | themes/default/layouts/partials/following-list.html | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/themes/default/layouts/partials/following-list.html b/themes/default/layouts/partials/following-list.html index ac86897..4f364d3 100644 --- a/themes/default/layouts/partials/following-list.html +++ b/themes/default/layouts/partials/following-list.html @@ -5,15 +5,16 @@ {{- if .Params.feed -}} {{- $following = $following | append (dict - "Name" .Params.feed.name "Domain" .Params.feed.domain + "Name" .Params.feed.name ) -}} {{- $unique = $unique | append (dict - "Name" .Params.feed.name "Domain" .Params.feed.domain "Favicon" .Params.feed.image + "Home" .Params.feed.home + "Name" .Params.feed.name ) -}} {{- end -}} @@ -26,9 +27,12 @@ {{- $name := .Name -}} {{- $favicon := .Domain -}} + {{- $href := print "http://" $author.Domain -}} + {{- range $unique := uniq $unique -}} {{- if and (eq $unique.Name $name) (eq $unique.Domain $favicon) -}} {{- $favicon = $unique.Favicon -}} + {{- $href = or $unique.Home $href -}} {{- end -}} {{- end -}} @@ -37,7 +41,7 @@ <micro-summary> <micro-thumbnail> <figure> - <a title="{{ $author.Name }}" href="http://{{ $author.Name }}"> + <a title="{{ $author.Name }}" href="{{ $href }}"> <picture> <img width="64" @@ -51,9 +55,9 @@ </micro-thumbnail> <micro-header> <h2><b>{{ $author.Name }}</b></h2> - <h3><a title="{{ $author.Name }}" href="http://{{ $author.Domain }}">@{{ $author.Domain }}</a></h3> + <h3><a title="{{ $author.Name }}" href="{{ $href }}">@{{ $author.Domain }}</a></h3> </micro-header> - <a title="Follow {{ $author.Name }}" href="http://{{ $author.Domain }}"> + <a title="Follow {{ $author.Name }}" href="{{ $href }}"> {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/rss.svg")) }} <span>Follow</span> </a> |