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.
8 lines
512 B
JSON
8 lines
512 B
JSON
{{- $searchDataFile := printf "search/%s.data.json" .Language.Lang -}}
|
|
{{- $searchData := resources.Get "search/data.json" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify -}}
|
|
{
|
|
"dataFile": {{ $searchData.RelPermalink | jsonify }},
|
|
"indexConfig": {{ .Site.Params.GeekdocSearchConfig | jsonify }},
|
|
"showParent": {{ if .Site.Params.GeekdocSearchShowParent }}true{{ else }}false{{ end }},
|
|
"showDescription": {{ if .Site.Params.GeekdocSearchshowDescription }}true{{ else }}false{{ end }}
|
|
}
|