Hello everybody,
for using a search engine I added a second output to my config, which produce a JSON file.
The layout for that JSON has this key/value pairs: "content" $element.Plain, "summary" $element.Summary
.
In some of my content markdown files, I uses a custom {{<img>}} shortcode with a caption key. That caption is for a image subtitle.
Now I would like to skip this custom shortcode in the JSON processing, so the caption will not include in the final output.
How can I do that? Is there any filter I can use?
The full JSON layout looks like:
{{- $.Scratch.Add "searchindex" slice -}}
{{- range $index, $element := (where .Site.Pages "Kind" "page") -}}
{{ $poster := "" }}
{{ if $element.Params.thumbnail }}
{{- $image := resources.Get $element.Params.thumbnail -}}
{{ if $image }}
{{ $poster = ($image.Fill "220x165 Center").RelPermalink }}
{{ end }}
{{ end }}
{{- $.Scratch.Add "searchindex" (
dict
"id" $index
"title" $element.Title
"url" $element.RelPermalink
"tags" $element.Params.tags
"section" $element.Section
"content" $element.Plain
"summary" $element.Summary
"published" ($element.Date.Format "2. Jan 2006")
"poster" $poster
"author" $element.Params.author
) -}}
{{- end -}}
{{- $.Scratch.Get "searchindex" | jsonify -}}