aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-12-12 02:19:38 -0500
committertdro <tdro@noreply.example.com>2022-12-12 02:19:38 -0500
commitaf3da3b30e221688af9a03b803b1d0bcdecf0d43 (patch)
tree8a1b45db1b737ee061817eb80c8d28871835c3ae
parent54927503bc8d02fa2e54b551adef285a4a0586cf (diff)
downloadcanory-af3da3b30e221688af9a03b803b1d0bcdecf0d43.tar.gz
canory-af3da3b30e221688af9a03b803b1d0bcdecf0d43.tar.bz2
canory-af3da3b30e221688af9a03b803b1d0bcdecf0d43.zip
themes/default/layouts/partials/following-list: Track from author's data
Add last active time stamp
-rw-r--r--themes/default/layouts/partials/following-list.html131
-rw-r--r--themes/default/layouts/partials/function-generate-feeds.html1
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