{{/* ranked draws a list in its style. Takes: Items, Category, Style, Title, and optionally AllLink/Total (home page: link to the full list). Podium and Spotlight feature #1, so a page that doesn't start at #1 falls back to a plain list. */}} {{define "ranked"}} {{- $featured := and (or (eq .Style "podium") (eq .Style "spotlight")) (eq (index .Items 0).Rank 1)}}
{{- if and $featured (eq .Style "podium")}}{{template "podium" .}} {{- else if $featured}}{{template "spotlight" .}} {{- else}}{{template "items" (dict "Items" .Items "Category" .Category "Layout" (flatLayout .Style))}} {{- end}}
{{end}} {{define "podium"}} {{- $c := .Category}} {{- $top := podium .Items}}
    {{- range $i, $spot := $top}} {{- if not $spot}} {{- else}} {{- with $spot}}
  1. {{- template "playbtn" .}}
  2. {{- end}} {{- end}} {{- end}}
{{- $rest := belowPlace 3 .Items}} {{- if $rest}}
Show {{len $rest}} moreShow less{{icon "chevron-down"}} {{template "items" (dict "Items" $rest "Category" $c "Layout" "rows")}} {{- if .AllLink}}See all {{num .Total}}{{icon "arrow-right"}}{{end}}
{{- else if .AllLink}} See all {{num .Total}}{{icon "arrow-right"}} {{- end}} {{end}} {{define "spotlight"}} {{- $c := .Category}} {{- with index .Items 0}}
{{- if .Image}}{{end}}
{{- template "playbtn" .}}

#1

{{.Title}}

{{- template "itemsub" .}} {{- with .Note}}
{{.}}
{{- else}}{{with .Description}}

{{.}}

{{end}}{{end}}
{{- end}} {{- $rest := after 1 .Items}} {{- if $rest}}{{template "items" (dict "Items" $rest "Category" $c "Layout" "rows")}}{{end}} {{- if .AllLink}}See all {{num .Total}}{{icon "arrow-right"}}{{end}} {{end}}