2020-04-15 09:46:50 +02:00
|
|
|
{{- $index := slice -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- $pages := .Site.RegularPages -}}
|
|
|
|
{{- if .Site.Params.page.hiddenFromSearch -}}
|
|
|
|
{{- $pages = where $pages "Params.hiddenfromsearch" false -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- $pages = where $pages "Params.hiddenfromsearch" "!=" true -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- range $pages -}}
|
2020-04-28 06:53:06 +02:00
|
|
|
{{- $one := dict "objectID" .RelPermalink "uri" .RelPermalink "title" .Title "description" (.Description | default "") -}}
|
|
|
|
{{- $tags := .Params.tags | default slice -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- $one = delimit $tags "\n" | dict "tags" | merge $one -}}
|
2020-04-21 16:55:06 +02:00
|
|
|
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormat | default "2006-01-02") -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- $one = dict "date" $publish_date | merge $one -}}
|
2020-04-28 07:01:11 +02:00
|
|
|
{{- $content := .RawContent | htmlEscape -}}
|
2020-04-15 09:46:50 +02:00
|
|
|
{{- if gt .Site.Params.search.contentLength 0 -}}
|
|
|
|
{{- $content = substr $content 0 .Site.Params.search.contentLength -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $one = dict "content" $content | merge $one -}}
|
|
|
|
{{- $index = $index | append $one -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $index | jsonify | safeJS -}}
|