With an index.json
with the code shown below, how do I pass truncate
to the .Params.excerpt
?
{{- $blog := slice -}}
{{ $post := where site.RegularPages "Type" "post" }}
{{- range $post -}}
{{- $item := dict
"Title" .Title
"PublishDateFormatted" (.PublishDate.Format "2006-01-02")
"RelPermalink" .RelPermalink
"PlainContent" .Params.excerpt -}}
{{- $blog = $blog | append $item -}}
{{- end -}}
{{- $object := dict "blog" $blog -}}
{{- if (eq site.Params.search_minify true) -}}
{{- $object | jsonify -}}
{{- else -}}
{{- $jsonifyOptions := dict "indent" " " -}}
{{- $object | jsonify $jsonifyOptions -}}
{{- end -}}