From 6bed014c0f3b70bbf8739ea2a48520dd154fa091 Mon Sep 17 00:00:00 2001 From: tdro Date: Mon, 26 Dec 2022 17:01:47 -0500 Subject: themes/default/layouts/_default/section.webring: Get distinct --- .../default/layouts/_default/section.webring.html | 28 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/themes/default/layouts/_default/section.webring.html b/themes/default/layouts/_default/section.webring.html index 8a90f96..d82efe0 100644 --- a/themes/default/layouts/_default/section.webring.html +++ b/themes/default/layouts/_default/section.webring.html @@ -1,13 +1,34 @@ +{{- $items := slice -}} +{{- $sources := slice -}} {{- $author := partial "function-authors-data.html" . -}} {{- $feeds := partial "function-generate-feeds.html" . -}} -{{ range first 3 (uniq (sort $feeds "FeedDateTime" "desc")) }} +{{- range $author.feeds.rss -}} + {{- $data := split . " " -}} + {{- $url := delimit (first 1 $data) "" -}} + {{- $sources = $sources | append (string $url) -}} +{{- end -}} + +{{- $inner := 1 -}} + +{{- if eq (len $sources) 1 -}} + {{- $inner = 3 -}} +{{- end -}} + +{{- range $source := (first 3 $sources) -}} + {{- range $distinct := first $inner (where $feeds "FeedSourceLink" "eq" $source) -}} + {{- $items = $items | append $distinct -}} + {{- end -}} +{{- end -}} + +{{- range (sort $items "FeedDateTime" "desc") -}} +
- {{ .FeedTitle }} + {{ or .FeedTitle (truncate 50 "..." (or .FeedContentShort .FeedDescriptionShort)) }}
-{{ end }} + +{{- end -}} -- cgit v1.2.3