2024-10-05 06:27:07 +00:00
|
|
|
{{- $.Scratch.Add "pagesIndex" slice -}}
|
2024-11-09 20:12:57 +00:00
|
|
|
{{- $pages := slice }}
|
|
|
|
{{- if eq .Kind "section" }}
|
|
|
|
{{- $pages = (where .Site.RegularPages "Path" "like" (printf "^%s" .CurrentSection.Path)) }}
|
|
|
|
{{- else if eq .Kind "term" }}
|
|
|
|
{{- $pages = .RegularPages }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range $index, $page := $pages -}}
|
2024-10-05 06:27:07 +00:00
|
|
|
{{- if gt (len $page.Content) 0 -}}
|
|
|
|
{{- $pageData := (dict "title" (or $page.Title $page.File.LogicalName) "href" $page.Permalink "content" $page.Plain) -}}
|
|
|
|
{{- $.Scratch.Add "pagesIndex" $pageData -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $.Scratch.Get "pagesIndex" | jsonify -}}
|