Files
hugo-theme-stack/layouts/page/search.json
T

17 lines
575 B
JSON
Raw Normal View History

2020-09-26 11:40:33 +02:00
{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
{{- $filtered := where $pages "Params.hidden" "!=" true -}}
2020-09-26 11:40:33 +02:00
{{- $result := slice -}}
{{- range $filtered -}}
{{- $data := dict "title" .Title "date" .Date "permalink" .RelPermalink "content" (.Plain) -}}
2020-09-26 11:40:33 +02:00
{{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources) -}}
{{- if $image -}}
{{- $data = merge $data (dict "image" $image.Permalink) -}}
2020-12-25 09:39:04 +01:00
{{- end -}}
2020-09-26 11:40:33 +02:00
{{- $result = $result | append $data -}}
{{- end -}}
{{ jsonify $result }}