I have the following code in a JSON file placed in /static directory. I want this json to be available at /search.json endpoint so that my client-side blog search works. There are no template errors but the template part isn’t rendered. What is pasted below is what I see when I visit the endpoint. Any ideas on how to evaluate the templating in the json file? Thanks!
[
{{ range .Data.Pages }}
{
"title" : "{{ .Title }}",
"article" : "<div class='article col col-12'> <div class='article__inner'> <div class='article__content'> <h2 class='article__title'> <a href='{{ .RelPermalink }}'>{{ .Title }}<i class='ion ion-md-arrow-round-forward'></i></a> </h2> <div class='article__meta'> <time class="article__date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2 January 2006" }}</time> – <span class='article__minutes'>{{ .ReadingTime }} min read</span> </div><p class='article__excerpt'>{{ .Summary }}</p></div></div></div>",
"category" : "{{ with .Params.categories }}{{ . }}{{ end }}",
"content" : "{{ .PlainWords }}",
"tags" : "{{ with .Params.tags }}{{ delimit . ", " }}{{ end }}",
"url" : "{{ .RelPermalink }}",
"date" : "{{ .Date.Format "2 January 2006" }}"
}
{{ end }}
]