hugo-theme-fha/layouts/index.json.json

21 lines
577 B
JSON

{{- if eq .Site.Params.enablesearch true -}}
{{- $post := slice -}}
{{- range where site.RegularPages.ByDate.Reverse "Section" "==" "posts" -}}
{{- $item := dict
"Title" .Title
"PlainContent" .Plain
"RelPermalink" .RelPermalink
-}}
{{- $post = $post | append $item -}}
{{- end -}}
{{- $object := dict "post" $post -}}
{{- if (eq site.Params.search_minify true) -}}
{{- $object | jsonify -}}
{{- else -}}
{{- $jsonifyOptions := dict "indent" " " -}}
{{- $object | jsonify $jsonifyOptions -}}
{{- end -}}
{{- end -}}