The search on my blog lives on the homepage, where some (very ugly) Javascript downloads the index file, parses it contents into an inverted index, and replaces the content on the page with search results whenever someone starts typing. Now, I don’t want that index.json file to basically be the list of links it is in the HTML version and in the RSS feed, so I added an index.json file in my layouts folder with the following content: [ {{ range $index, $page := .Site.Pages }} {{- if eq $page.Type "post" -}} {{- if $page.Plain -}} {{- if and $index (gt $index 0) -}},{{- end }} { "href": "{{ $page.Permalink }}", "title": "{{ htmlEscape $page.Title }}", "categories": [{{ range $tindex, $tag := $page.Params.categories }}{{ if $tindex }}, {{ end }}"{{ $tag| htmlEscape }}"{{ end }}], "content":…