diff options
Diffstat (limited to 'themes/default/layouts/partials/following-list.html')
-rw-r--r-- | themes/default/layouts/partials/following-list.html | 80 |
1 files changed, 8 insertions, 72 deletions
diff --git a/themes/default/layouts/partials/following-list.html b/themes/default/layouts/partials/following-list.html index e99a86b..165d699 100644 --- a/themes/default/layouts/partials/following-list.html +++ b/themes/default/layouts/partials/following-list.html @@ -1,79 +1,15 @@ -{{- $feeds := slice -}} -{{- $paths := slice -}} {{- $author := partial "function-authors-data.html" . -}} - -{{- range $author.feeds.rss -}} - {{- $data := split . " " -}} - {{- $url := delimit (first 1 $data) "" -}} - {{- $feeds = $feeds | append (string $url) -}} -{{- end -}} +{{- $following := print "public/" $author.user "/following.html" -}} <following-list> <h1>Following</h1> <aside> - {{- 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 first 1 $following -}} - - {{- $href := or .Params.feed.home (print "http://" .Params.feed.domain) -}} - - <micro-author> - <micro-card> - <micro-summary> - <micro-thumbnail> - <figure> - <a - title="{{ .Params.feed.name }}" - href="{{ $href }}"> - <picture> - <img - width="64" - height="64" - alt="{{ .Params.feed.name }}" - src="{{ .Params.feed.favicon }}" - /> - </picture> - </a> - </figure> - </micro-thumbnail> - <micro-header> - <h2> - <b>{{ .Params.feed.name }}</b> - </h2> - <h3> - <a - title="{{ .Params.feed.name }}" - href="{{ $href }}"> - @{{ .Params.feed.domain }} - </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") -}} - </time> - </micro-header> - <a - title="Follow {{ .Params.feed.name }}" - href="{{ $href }}"> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/rss.svg")) }} - <span>Follow</span> - </a> - </micro-summary> - </micro-card> - </micro-author> - {{- else -}} - <footer> - <code>No feeds found!</code> - </footer> - {{- end -}} - {{- else -}} - <footer> - <code>No feeds found!</code> - </footer> - {{- end -}} + {{- if and $author.feeds.rss (fileExists $following) -}} + {{- (resources.Get $following).Content | safeHTML -}} + {{- else -}} + <footer> + <code>No feeds found!</code> + </footer> + {{- end -}} </aside> </following-list> |