diff options
author | tdro <tdro@noreply.example.com> | 2023-06-18 18:32:33 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-06-18 18:32:33 -0400 |
commit | 69591d98d61888c211b986bf96a36014590b4cbf (patch) | |
tree | d5e2dc71a73ea77786080ab5fb2a3878cab65b37 /themes/default/layouts/_default/section.following.html | |
parent | 23b45c260c734539c684df8b713c32dbea375532 (diff) | |
download | canory-69591d98d61888c211b986bf96a36014590b4cbf.tar.gz canory-69591d98d61888c211b986bf96a36014590b4cbf.tar.bz2 canory-69591d98d61888c211b986bf96a36014590b4cbf.zip |
themes/default/layouts/_default/section: Write gallery, webring, following once
Check for parent node
Diffstat (limited to 'themes/default/layouts/_default/section.following.html')
-rw-r--r-- | themes/default/layouts/_default/section.following.html | 120 |
1 files changed, 62 insertions, 58 deletions
diff --git a/themes/default/layouts/_default/section.following.html b/themes/default/layouts/_default/section.following.html index eef5e12..7057e97 100644 --- a/themes/default/layouts/_default/section.following.html +++ b/themes/default/layouts/_default/section.following.html @@ -1,65 +1,69 @@ -{{- $sources := slice -}} -{{- $author := partial "function-authors-data.html" . -}} -{{- $feeds := partial "function-generate-feeds.html" . -}} +{{- $parent := eq (len .Page.Ancestors) 1 -}} -{{- range $author.feeds.rss -}} - {{- $data := split . " " -}} - {{- $url := delimit (first 1 $data) "" -}} - {{- $sources = $sources | append (string $url) -}} -{{- end -}} +{{- if $parent -}} + {{- $sources := slice -}} + {{- $author := partial "function-authors-data.html" . -}} + {{- $feeds := partial "function-generate-feeds.html" . -}} + + {{- range $author.feeds.rss -}} + {{- $data := split . " " -}} + {{- $url := delimit (first 1 $data) "" -}} + {{- $sources = $sources | append (string $url) -}} + {{- end -}} -{{- range $source := (first 3 (shuffle $sources)) -}} - {{- range $distinct := first 1 (where $feeds "FeedSourceLink" "eq" $source) -}} + {{- range $source := (first 3 (shuffle $sources)) -}} + {{- range $distinct := first 1 (where $feeds "FeedSourceLink" "eq" $source) -}} - {{- $href := or $distinct.FeedHome (print "http://" $distinct.FeedSourceDomain) -}} - {{- $favicon := print "/" (partial "function-paths.html").media "/favicon." (.FeedSourceLink | anchorize) ".png" -}} + {{- $href := or $distinct.FeedHome (print "http://" $distinct.FeedSourceDomain) -}} + {{- $favicon := print "/" (partial "function-paths.html").media "/favicon." (.FeedSourceLink | anchorize) ".png" -}} - <micro-author> - <micro-card> - <micro-summary> - <micro-thumbnail> - <figure> - <a - title="{{ $distinct.FeedName }}" - href="{{ $href }}"> - <picture> - <img - width="64" - height="64" - alt="{{ $distinct.FeedName }}" - src="{{ $.Site.BaseURL }}{{ $favicon }}" - /> - </picture> - </a> - </figure> - </micro-thumbnail> - <micro-header> - <h2> - <b>{{ $distinct.FeedName }}</b> - </h2> - <h3> - <a - data-hover - title="{{ $distinct.FeedName }}" - href="{{ $href }}"> - @{{ $distinct.FeedSourceDomain }} - </a> - </h3> - <time - title="{{ $distinct.FeedDateTitle }}" - datetime="{{ $distinct.FeedDateTime }}"> - {{ $distinct.FeedDateTime | time.Format "15:04 Jan 2 2006" -}} - </time> - </micro-header> - <a - title="Follow {{ $distinct.FeedName }}" - href="{{ $href }}"> - {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/rss.svg")) }} - <header>Follow</header> - </a> - </micro-summary> - </micro-card> - </micro-author> + <micro-author> + <micro-card> + <micro-summary> + <micro-thumbnail> + <figure> + <a + title="{{ $distinct.FeedName }}" + href="{{ $href }}"> + <picture> + <img + width="64" + height="64" + alt="{{ $distinct.FeedName }}" + src="{{ $.Site.BaseURL }}{{ $favicon }}" + /> + </picture> + </a> + </figure> + </micro-thumbnail> + <micro-header> + <h2> + <b>{{ $distinct.FeedName }}</b> + </h2> + <h3> + <a + data-hover + title="{{ $distinct.FeedName }}" + href="{{ $href }}"> + @{{ $distinct.FeedSourceDomain }} + </a> + </h3> + <time + title="{{ $distinct.FeedDateTitle }}" + datetime="{{ $distinct.FeedDateTime }}"> + {{ $distinct.FeedDateTime | time.Format "15:04 Jan 2 2006" -}} + </time> + </micro-header> + <a + title="Follow {{ $distinct.FeedName }}" + href="{{ $href }}"> + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/rss.svg")) }} + <header>Follow</header> + </a> + </micro-summary> + </micro-card> + </micro-author> + {{- end -}} {{- end -}} {{- end -}} |