fb905bd6c1
Add optional page description to the search result list. The feature can be enabled by `geekdocSearchShowDescription=true` and is disabled by default. The max length of the description is set to `55` and will be truncated automatically if the limit is exceeded.
13 lines
491 B
JSON
13 lines
491 B
JSON
[
|
|
{{ range $index, $page := (where .Site.Pages "Params.GeekdocProtected" "ne" true) }}
|
|
{{ if ne $index 0 }},{{ end }}
|
|
{
|
|
"id": {{ $index }},
|
|
"href": "{{ $page.RelPermalink }}",
|
|
"title": {{ (partial "utils/title" $page) | jsonify }},
|
|
"parent": {{ with $page.Parent }}{{ (partial "utils/title" .) | jsonify }}{{ else }}""{{ end }},
|
|
"content": {{ $page.Plain | jsonify }},
|
|
"description": {{ $page.Summary | plainify | jsonify }}
|
|
}
|
|
{{ end }}
|
|
]
|