2023-06-28 16:33:02 +08:00
|
|
|
{{ $limit := .Site.Params.algoliaSearch.limit | default 1000 }}
|
2022-08-01 17:14:22 +08:00
|
|
|
[
|
2023-01-01 21:12:58 +08:00
|
|
|
{{ range $index, $entry := where .Site.RegularPages "Kind" "page" }}
|
|
|
|
{{ if $index }}, {{ end }}
|
2022-08-01 17:14:22 +08:00
|
|
|
{
|
2022-10-04 14:19:01 +08:00
|
|
|
"objectID": "{{ .Date.Unix }}",
|
2022-08-01 17:14:22 +08:00
|
|
|
"permalink": "{{ .Permalink | relURL }}",
|
|
|
|
"title": {{ .Title | jsonify }},
|
2023-06-28 16:33:02 +08:00
|
|
|
{{ if gt .WordCount $limit }}
|
|
|
|
"content": {{ .Plain | truncate $limit | jsonify | safeJS }},
|
|
|
|
{{ else }}
|
2022-10-04 14:19:01 +08:00
|
|
|
"content": {{ .Plain | jsonify | safeJS }},
|
2023-06-28 16:33:02 +08:00
|
|
|
{{ end }}
|
2022-08-01 17:14:22 +08:00
|
|
|
"date": {{ .Date.Format $.Site.Params.timeFormat | jsonify }},
|
|
|
|
"updated": {{ .Lastmod.Format $.Site.Params.timeFormat | jsonify }}
|
|
|
|
}
|
2023-01-01 21:12:58 +08:00
|
|
|
{{ end }}
|
2022-08-01 17:14:22 +08:00
|
|
|
]
|