{{ define "main" }} {{/* Enable Alpine.js for tag filtering */}} {{ .Store.Set "has_alpine" true }} {{/* Collect all unique tags from slides */}} {{ $allTags := slice }} {{ $featuredPages := slice }} {{ $regularPages := slice }} {{ $search_placeholder := i18n "slides_search_placeholder" | default "Search decks by title..." }} {{ $all_label := i18n "all" | default "All" }} {{ $no_decks_label := i18n "slides_no_decks" | default "No slide decks found" }} {{ $no_matches_label := i18n "slides_no_matches" | default "No decks match your filters" }} {{ $clear_filters_label := i18n "clear_filters" | default "Clear filters" }} {{ range .Pages }} {{ if .Params.tags }} {{ range .Params.tags }} {{ $allTags = $allTags | append . }} {{ end }} {{ end }} {{ if or .Params.featured .Params.pinned }} {{ $featuredPages = $featuredPages | append . }} {{ else }} {{ $regularPages = $regularPages | append . }} {{ end }} {{ end }} {{ $allTags = $allTags | uniq | sort }} {{/* Sort featured by date descending, then regular by date descending */}} {{ $featuredPages = sort $featuredPages ".Date" "desc" }} {{ $regularPages = sort $regularPages ".Date" "desc" }} {{ $sortedPages := $featuredPages | append $regularPages }}
{{/* Page Header */}}

{{ .Title }}

{{ with .Content }}
{{ . }}
{{ end }}
{{/* Search and Filter Bar */}}
{{/* Search input */}}
{{/* Tag Filter Chips */}} {{ if $allTags }}
{{ range $allTags }} {{ end }}
{{ end }}
{{/* Decks Grid */}} {{ $view := .Params.view | default "slides-gallery" }} {{ $config := dict "columns" (.Params.columns | default 2) "len" (len $sortedPages) "fill_image" (.Params.fill_image | default true) "show_date" (.Params.show_date | default true) }} {{ partial "functions/render_view" (dict "fragment" "start" "page" . "item" . "view" $view "config" $config) }} {{ range $index, $item := $sortedPages }} {{ $tags := $item.Params.tags | default (slice) }} {{ $tagsJson := $tags | jsonify }} {{ $authorList := slice }} {{ with $item.Params.authors }} {{ if reflect.IsSlice . }} {{ $authorList = . }} {{ else }} {{ $authorList = slice . }} {{ end }} {{ end }} {{ $authorNames := slice }} {{ range $authorList }} {{ $profile := partial "functions/get_author_profile" . }} {{ $authorName := . }} {{ if $profile.has_data }} {{ $authorName = $profile.title }} {{ end }} {{ $authorNames = $authorNames | append $authorName }} {{ end }} {{ $searchParts := slice $item.Title }} {{ with $item.Params.venue }} {{ $searchParts = $searchParts | append . }} {{ end }} {{ if gt (len $authorNames) 0 }} {{ $searchParts = $searchParts | append (delimit $authorNames " ") }} {{ end }} {{ if gt (len $tags) 0 }} {{ $searchParts = $searchParts | append (delimit $tags " ") }} {{ end }} {{ $searchText := (delimit $searchParts " ") | lower }}
{{ partial "functions/render_view" (dict "page" $ "item" $item "view" $view "index" $index "config" $config) }}
{{ end }} {{ partial "functions/render_view" (dict "fragment" "end" "page" . "item" . "view" $view) }} {{/* Empty state */}} {{ if eq (len $sortedPages) 0 }}

{{ $no_decks_label }}

{{ end }} {{/* No matches empty state */}}

{{ $no_matches_label }}

{{ end }}