mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-11-28 15:40:36 +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.
17 lines
593 B
HTML
17 lines
593 B
HTML
{{ if default true .Site.Params.GeekdocSearch }}
|
|
<div class="gdoc-search flex align-center">
|
|
<svg class="gdoc-icon gdoc_search"><use xlink:href="#gdoc_search"></use></svg>
|
|
<input
|
|
type="text"
|
|
id="gdoc-search-input"
|
|
class="gdoc-search__input"
|
|
placeholder="{{ i18n "form_placeholder_search" }}..."
|
|
aria-label="{{ i18n "form_placeholder_search" }}"
|
|
maxlength="64"
|
|
data-site-base-url="{{ .Site.BaseURL }}"
|
|
data-site-lang="{{ .Site.Language.Lang }}"
|
|
/>
|
|
<ul id="gdoc-search-results" class="gdoc-search__list"></ul>
|
|
</div>
|
|
{{ end }}
|