{{ $groups := slice }} {{ $headless := .Site.GetPage "/faqitems" }} {{ $faqItems := $headless.Resources.Match "*" }} {{ range $faqItems }} {{ $groups = $groups | append .Params.group }} {{ end }} {{ $groups = uniq $groups }}
{{ $.Scratch.Set "groupindex" 0 }} {{ range $groups }} {{ $group := . }} {{ $.Scratch.Set "groupindex" (add ($.Scratch.Get "groupindex") 1) }}

{{ $.Scratch.Get "groupindex" }}. {{ $group }}

{{ $.Scratch.Set "qindex" 0 }} {{ range where $faqItems "Params.group" $group }} {{ $.Scratch.Set "qindex" (add ($.Scratch.Get "qindex") 1) }}

{{ $.Scratch.Get "groupindex" }}.{{ $.Scratch.Get "qindex" }} {{ .Params.question }}

{{ .Content }} {{ end }}

{{ end }}