diff options
Diffstat (limited to 'themes/default/layouts/_default/section.webring.html')
-rw-r--r-- | themes/default/layouts/_default/section.webring.html | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/themes/default/layouts/_default/section.webring.html b/themes/default/layouts/_default/section.webring.html new file mode 100644 index 0000000..58181e1 --- /dev/null +++ b/themes/default/layouts/_default/section.webring.html @@ -0,0 +1,66 @@ +{{- $parent := eq (len .Page.Ancestors) 1 -}} + +{{- $modified := partial "function-page-modified.html" + (dict + "Context" . + "Disable" true + ) +-}} + +{{- if (and $parent $modified) -}} + {{- $items := 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) "" -}} + {{- $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") -}} + <article> + <h2> + <a + data-hover + title="{{ .FeedLink }}" + href="{{ .FeedLink }}"> + {{ or .FeedTitle (truncate 50 "..." (or .FeedContentShort .FeedDescriptionShort)) }} + </a> + </h2> + <p> + {{ if gt (len .FeedDescriptionShort) (len .FeedContentShort) -}} + {{ or .FeedDescriptionShort .FeedTitle }} + {{- else -}} + {{ or .FeedContentShort .FeedTitle }} + {{- end }} + <br /> + <a + data-hover + title="{{ .FeedSourceDescription }}" + href="{{ or .FeedSourceHome .FeedSourceLink }}"> + {{ .FeedSourceTitle }} + </a> + </p> + <time + data-type="default" + title="{{ .FeedDateTitle }}" + datetime="{{ .FeedDateTime }}"> + {{ .FeedDate }} + </time> + </article> + {{- end -}} +{{- end -}} |