mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-11-25 14:20:42 +00:00
Robert Kaussow
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.
9 lines
512 B
JSON
9 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 }}
|
|
}
|