In my case, this code only works when ranging without $index, not with $index
Range:
[
{{- range $index, $page := (where .Site.RegularPages "Type" "in" (slice "type_a" "type_o" "type_ab" )) -}}
{{- if gt $index 0 -}} , {{- end -}}
- In the following, given .Site.Params.default is set, {{ partial “debugprint” . }} lists data, indicating matches.
{{- with .Site.Params.default -}}
{{- $match := . -}}
{{- with $.Site.GetPage "section" "headless" -}}
{{- with .Resources.GetMatch $match -}}
{{ partial "debugprint" . }}
{{- end -}}
{{- end -}}
{{- end -}}
- Next, given .Params.featureImage is set for any .Site.RegularPages, {{ partial “debugprint” . }} lists data, indicating matches.
{{- with .Params.featureImage -}}
{{- $match := . -}}
{{- with $.Site.GetPage "section" "headless" -}}
{{- with .Resources.GetMatch $match -}}
{{ partial "debugprint" . }}
{{- end -}}
{{- end -}}
{{- end -}}
- Next, although .Params.featureImage is set for any .Site.RegularPages, {{ partial “debugprint” . }} does not list data, indicating no matches.
{{- with .Params.featureImage -}}
{{- $match := . -}}
{{- with $.Page.Resources.GetMatch $match -}}
{{ partial "debugprint" . }}
{{- end -}}
{{- end -}}
Close Range:
{{- end -}}
]
What is the correct . syntax for: {{- with $.Page.Resources.GetMatch $match -}}
to get page bundle matches in 3 ?
Thanks everyone for your productivity (especially, it seems, Bep)