Recently, I had use the Hugo engine to rebuild my blog site. Then I meet a trouble that there can output a special file which I want to create the indexes from all pages. I want it was XML formatter file include each blog title, content, date and so on. So I had create the indexes.xml file into the layouts/_default folder, but after I run hugo -d command and I could not find it under the site root’s folder. I don’t known what’s wrong in this way, is someone can help me or give a suggest, thanks.
indexes.xml file content:
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<search>
{{range where .Site.RegularPages "Section" "post"}}
<entry>
<title>{{ .Title }}</title>
<url>{{ .Permalink }}</url>
<categories>
{{ range .Params.categories }}<category>{{ . }}</category>{{ end }}
</categories>
<tags>
{{ range .Params.tags }}
<tag>{{ . }}</tag>
{{ end }}
</tags>
<content type="html"> {{ .Content | plainify }}</content>
</entry>
{{ end }}
</search>