diff options
Diffstat (limited to 'themes/default/layouts/_default/section.following.html')
-rw-r--r-- | themes/default/layouts/_default/section.following.html | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/themes/default/layouts/_default/section.following.html b/themes/default/layouts/_default/section.following.html index fc48172..ad3886d 100644 --- a/themes/default/layouts/_default/section.following.html +++ b/themes/default/layouts/_default/section.following.html @@ -1,21 +1,18 @@ -{{- $feeds := slice -}} -{{- $paths := slice -}} +{{- $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) "" -}} - {{- $feeds = $feeds | append (string $url) -}} + {{- $sources = $sources | append (string $url) -}} {{- end -}} -{{- range first 3 (shuffle $feeds) -}} - {{- $sources := where $.Site.RegularPages "Params.feed.source" . -}} - {{- $via := where $.Site.RegularPages "Params.Author" $author.user -}} - {{- $following := $via | intersect $sources -}} +{{- range $source := (first 3 (shuffle $sources)) -}} + {{- range $distinct := first 1 (where $feeds "FeedSourceLink" "eq" $source) -}} - {{- range first 1 $following -}} - - {{- $href := or .Params.feed.home (print "http://" .Params.feed.domain) -}} + {{- $href := or $distinct.FeedHome (print "http://" $distinct.FeedSourceDomain) -}} + {{- $favicon := print "/" (partial "function-paths.html" "media") "/favicon." (.FeedSourceLink | anchorize) ".png" -}} <micro-author> <micro-card> @@ -23,14 +20,14 @@ <micro-thumbnail> <figure> <a - title="{{ .Params.feed.name }}" + title="{{ $distinct.FeedName }}" href="{{ $href }}"> <picture> <img width="64" height="64" - alt="{{ .Params.feed.name }}" - src="{{ .Params.feed.favicon }}" + alt="{{ $distinct.FeedName }}" + src="{{ $.Site.BaseURL }}{{ $favicon }}" /> </picture> </a> @@ -38,23 +35,23 @@ </micro-thumbnail> <micro-header> <h2> - <b>{{ .Params.feed.name }}</b> + <b>{{ $distinct.FeedName }}</b> </h2> <h3> <a - title="{{ .Params.feed.name }}" + title="{{ $distinct.FeedName }}" href="{{ $href }}"> - @{{ .Params.feed.domain }} + @{{ $distinct.FeedSourceDomain }} </a> </h3> <time - title="{{ .Date | time.Format "Monday, January 2, 2006 at 15:04:05 MST" }}" - datetime="{{ .Date | time.Format "2006-01-02T15:04:05Z" }}"> - {{ (.Date.Local | time.Format "3:04 PM Jan 2 2006") -}} + title="{{ $distinct.FeedDateTitle }}" + datetime="{{ $distinct.FeedDateTime }}"> + {{ $distinct.FeedDateTime | time.Format "3:04 PM Jan 2 2006" -}} </time> </micro-header> <a - title="Follow {{ .Params.feed.name }}" + title="Follow {{ $distinct.FeedName }}" href="{{ $href }}"> {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/rss.svg")) }} <span>Follow</span> @@ -62,5 +59,6 @@ </micro-summary> </micro-card> </micro-author> + {{- end -}} {{- end -}} |