{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} {{ $sections := .Site.Params.mainSections }} {{ $.Scratch.Set "authors" (slice ) }} {{ $.Scratch.Set "noAuthors" 0 }} {{ range where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} {{ with .Params.authors }} {{ if eq ( printf "%T" . ) "[]string" }} {{ if ( not ( in ($.Scratch.Get "authors") . ) ) }} {{ $.Scratch.Add "authors" . }} {{ end }} {{ else if ( printf "%T" . ) "[]string" }} {{ range . }} {{ if ( not ( in ($.Scratch.Get "authors") . ) ) }} {{ $.Scratch.Add "authors" . }} {{ end }} {{ end }} {{ end }} {{ else }} {{ $.Scratch.Add "noAuthors" 1 }} {{ end }} {{ end }} {{ $tags := $.Site.Taxonomies.tags.ByCount }} {{ $.Scratch.Set "untagged" 0 }} {{ range $pages }} {{ with .Params.tags }}{{ else }}{{ $.Scratch.Add "untagged" 1 }}{{ end }} {{ end }}

Sections

{{ range $sections }} {{ end }}

Authors

{{ range $.Scratch.Get "authors" }} {{ end }} {{ if gt ( $.Scratch.Get "noAuthors") 0 }} {{ end }}

Tags

{{ range $tags }} {{ if .Term }} {{ end }} {{ end }} {{ if gt ( $.Scratch.Get "untagged") 0 }} {{ end }}

Items

{{ range $pages.ByPublishDate.Reverse }} {{ if in .Params.categories "tv"}} {{- partial "video_box.html" . -}} {{ else if in .Params.categories "calendar" }} {{- partial "calendar_card.html" . -}} {{ else if in .Params.categories "network" }} {{- partial "network_card.html" . -}} {{ else if in .Params.categories "pen" }} {{- partial "pen_card.html" . -}} {{ else if in .Params.categories "shouts" }} {{- partial "shout_card.html" . -}} {{ else if in .Params.categories "books.lumbung.space"}} {{- partial "book_card.html" . -}} {{ else }} {{- partial "card.html" . -}} {{ end }} {{ end }}