🔧 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

@ -68,8 +68,15 @@ outputFormats:
# 自定义生成本地搜索文件
# Custom file of indexes for local search
SearchIndexes:
mediaType: "application/xml"
baseName: "searchindexes"
mediaType: application/xml
baseName: searchindexes
isPlainText: true
notAlternative: true
# 生成 Algolia 索引文件
# Build indexes of Aloglia
AlgoliaIndexes:
mediaType: application/json
baseName: algolia
isPlainText: true
notAlternative: true

View File

@ -0,0 +1,12 @@
[
{{- range $index, $entry := where .Site.RegularPages "Kind" "page" }}
{{- if $index }}, {{ end }}
{
"permalink": "{{ .Permalink | relURL }}",
"title": {{ .Title | jsonify }},
"content": {{ replace .Plain | jsonify }},
"date": {{ .Date.Format $.Site.Params.timeFormat | jsonify }},
"updated": {{ .Lastmod.Format $.Site.Params.timeFormat | jsonify }}
}
{{- end }}
]