🔧 Add algolia search indexes content.
This commit is contained in:
parent
34faa6f6f3
commit
ac844e4e8c
@ -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
|
||||
|
||||
|
12
layouts/_default/list.algoliaindexes.json
Normal file
12
layouts/_default/list.algoliaindexes.json
Normal 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 }}
|
||||
]
|
Loading…
Reference in New Issue
Block a user