diff options
Diffstat (limited to 'themes/default/layouts')
-rw-r--r-- | themes/default/layouts/partials/following-list.html | 131 | ||||
-rw-r--r-- | themes/default/layouts/partials/function-generate-feeds.html | 1 |
2 files changed, 68 insertions, 64 deletions
diff --git a/themes/default/layouts/partials/following-list.html b/themes/default/layouts/partials/following-list.html index d638487..6dbf6e8 100644 --- a/themes/default/layouts/partials/following-list.html +++ b/themes/default/layouts/partials/following-list.html @@ -1,74 +1,77 @@ -{{- $unique := slice -}} -{{- $following := slice -}} +{{- $feeds := slice -}} +{{- $paths := slice -}} +{{- $author := partial "function-authors-data.html" . -}} -{{- range (where .Site.Pages "Params.Author" (partial "author-user.html" .)) -}} - {{- if .Params.feed -}} - {{- - $following = $following | append (dict - "Domain" .Params.feed.domain - "Name" .Params.feed.name - ) - -}} - {{- - $unique = $unique | append (dict - "Domain" .Params.feed.domain - "Favicon" .Params.feed.favicon - "Home" .Params.feed.home - "Name" .Params.feed.name - ) - -}} - {{- end -}} +{{- range $author.feeds.rss -}} + {{- $data := split . " " -}} + {{- $url := delimit (first 1 $data) "" -}} + {{- $feeds = $feeds | append (string $url) -}} {{- end -}} <following-list> <h1>Following</h1> - <aside> - {{ range $author := first 3 (shuffle (uniq $following)) }} + {{ if $feeds }} + <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 -}} - {{- $name := .Name -}} - {{- $favicon := .Domain -}} - {{- $href := print "http://" $author.Domain -}} + {{- range first 1 $following -}} - {{- range $unique := uniq $unique -}} - {{- if and (eq $unique.Name $name) (eq $unique.Domain $favicon) -}} - {{- $favicon = $unique.Favicon -}} - {{- $href = or $unique.Home $href -}} - {{- end -}} - {{- end -}} + {{- $href := or .Params.feed.home (print "http://" .Params.feed.domain) -}} - <micro-author> - <micro-card> - <micro-summary> - <micro-thumbnail> - <figure> - <a title="{{ $author.Name }}" href="{{ $href }}"> - <picture> - <img - width="64" - height="64" - alt="{{ $author.Name }}" - src="{{ $favicon }}" - /> - </picture> + <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> - </figure> - </micro-thumbnail> - <micro-header> - <h2><b>{{ $author.Name }}</b></h2> - <h3><a title="{{ $author.Name }}" href="{{ $href }}">@{{ $author.Domain }}</a></h3> - </micro-header> - <a title="Follow {{ $author.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> - {{- end -}} - </aside> - {{- if not $following -}} - <footer> - <code>No feeds found!</code> - </footer> - {{- end -}} + </micro-summary> + </micro-card> + </micro-author> + {{- end -}} + {{- end -}} + </aside> + {{ else }} + <footer> + <code>No feeds found!</code> + </footer> + {{ end }} </following-list> diff --git a/themes/default/layouts/partials/function-generate-feeds.html b/themes/default/layouts/partials/function-generate-feeds.html index f9bb4a9..74019c0 100644 --- a/themes/default/layouts/partials/function-generate-feeds.html +++ b/themes/default/layouts/partials/function-generate-feeds.html @@ -233,6 +233,7 @@ "markdown" (strings.TrimLeft "/" $path) "name" .FeedName "self" (print $author.user "/feeds/" $file "/") + "source" .FeedSourceLink "tags" "[rss]" ) $template |