From bebd27973535d22b263332bd33bf6f84dac6a67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Tue, 4 Oct 2022 14:19:01 +0800 Subject: [PATCH] :construction_worker: Upgrade Algolia search indexes with objectID. --- layouts/_default/list.algoliaindexes.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/_default/list.algoliaindexes.json b/layouts/_default/list.algoliaindexes.json index 91124c1..28a550b 100644 --- a/layouts/_default/list.algoliaindexes.json +++ b/layouts/_default/list.algoliaindexes.json @@ -2,9 +2,10 @@ {{- range $index, $entry := where .Site.RegularPages "Kind" "page" }} {{- if $index }}, {{ end }} { + "objectID": "{{ .Date.Unix }}", "permalink": "{{ .Permalink | relURL }}", "title": {{ .Title | jsonify }}, - "content": {{ .Plain | jsonify }}, + "content": {{ .Plain | jsonify | safeJS }}, "date": {{ .Date.Format $.Site.Params.timeFormat | jsonify }}, "updated": {{ .Lastmod.Format $.Site.Params.timeFormat | jsonify }} }