👷 Upgrade Algolia search indexes with objectID.

This commit is contained in:
凡梦星尘 2022-10-04 14:19:01 +08:00
parent 9f2b1f37f8
commit bebd279735

View File

@ -2,9 +2,10 @@
{{- range $index, $entry := where .Site.RegularPages "Kind" "page" }} {{- range $index, $entry := where .Site.RegularPages "Kind" "page" }}
{{- if $index }}, {{ end }} {{- if $index }}, {{ end }}
{ {
"objectID": "{{ .Date.Unix }}",
"permalink": "{{ .Permalink | relURL }}", "permalink": "{{ .Permalink | relURL }}",
"title": {{ .Title | jsonify }}, "title": {{ .Title | jsonify }},
"content": {{ .Plain | jsonify }}, "content": {{ .Plain | jsonify | safeJS }},
"date": {{ .Date.Format $.Site.Params.timeFormat | jsonify }}, "date": {{ .Date.Format $.Site.Params.timeFormat | jsonify }},
"updated": {{ .Lastmod.Format $.Site.Params.timeFormat | jsonify }} "updated": {{ .Lastmod.Format $.Site.Params.timeFormat | jsonify }}
} }