trwnh.com/unified.test.hugo/layouts/index.json
2024-10-05 01:27:07 -05:00

8 lines
No EOL
381 B
JSON

{{- $.Scratch.Add "pagesIndex" slice -}}
{{- range $index, $page := .Site.RegularPages -}}
{{- 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 -}}