{{- define "main" -}} {{/* Enable Alpine.js for interactive FAQ accordion */}} {{ .Page.Store.Set "has_alpine" true }} {{/* Pagefind metadata for search filtering */}}
{{/* Use hidden spans for filter values - best practice per Pagefind docs */}} faq {{ with .Params.categories }} {{ index . 0 }} {{ end }}
{{ partial "components/sidebar.html" (dict "context" . "no_sidebar" false) }} {{ partial "components/toc.html" . }}
{{ if (.Params.show_breadcrumb | default true) }}
{{ partial "components/breadcrumb.html" . }}
{{ end }}

{{ .Title }}

{{ with .Content }}
{{ . }}
{{ end }} {{/* FAQ Accordion */}} {{ with .Params.faqs }}
{{ range $index, $item := . }}
{{ $item.answer | markdownify }}
{{ end }}
{{ end }} {{/* If no explicit FAQs, show child pages as FAQ items */}} {{ if not .Params.faqs }} {{ $child_pages := .Pages }} {{ if $child_pages }}
{{ range $index, $page := $child_pages }}
{{ if $page.Params.answer }} {{ $page.Params.answer | markdownify }} {{ else }} {{ $page.Content }} {{ end }}
{{ if not $page.Params.answer }} {{ T "read_more" | default "Read more" }} → {{ end }}
{{ end }}
{{ end }} {{ end }} {{ partial "components/last-edited.html" . }} {{ partial "components/feedback.html" . }} {{ partial "comments.html" . }}
{{/* End Pagefind metadata wrapper */}} {{- end -}}