🔧 Add algolia search indexes content.

This commit is contained in:
凡梦星尘
2022-08-01 17:14:22 +08:00
parent 34faa6f6f3
commit ac844e4e8c
3 changed files with 21 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<search>
{{range where .Site.RegularPages "Kind" "page"}}
<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"><![CDATA[{{ .Content | plainify }}]]></content>
</entry>
{{ end }}
</search>