Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zzossig/hugo-theme-zzo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzzossig <zzossig@gmail.com>2021-04-20 21:53:59 +0300
committerzzossig <zzossig@gmail.com>2021-04-20 21:53:59 +0300
commit6258d4dde546706fcdb79f7d7060ee75a02a06ad (patch)
tree6adb0b6bcea9de66656f2bcde8643f340404533d /layouts
parent272be8ac8836cbd1d595594497810ab8576719d9 (diff)
new param: searchThreshold
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/head/scripts.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/layouts/partials/head/scripts.html b/layouts/partials/head/scripts.html
index cf2d608..3f0ba08 100644
--- a/layouts/partials/head/scripts.html
+++ b/layouts/partials/head/scripts.html
@@ -664,6 +664,8 @@
var enableSearch = JSON.parse({{ $enableSearch | jsonify }});
{{ $searchDistance := ($.Param "searchDistance") }}
var searchDistance = JSON.parse({{ $searchDistance | jsonify }});
+ {{ $searchThreshold := ($.Param "searchThreshold") }}
+ var searchThreshold = JSON.parse({{ $searchThreshold | jsonify }});
{{ $searchContent := ($.Param "searchContent") }}
var searchContent = JSON.parse({{ $searchContent | jsonify }});
{{ $enableSearchHighlight := ($.Param "enableSearchHighlight") }}
@@ -694,7 +696,7 @@
searchContent ? ['title', 'description', 'content'] : ['title', 'description'],
includeMatches: enableSearchHighlight,
shouldSort: true, // default: true
- threshold: 0.4, // default: 0.6 (0.0 requires a perfect match)
+ threshold: searchThreshold ? searchThreshold : 0.4, // default: 0.6 (0.0 requires a perfect match)
location: 0, // default: 0
distance: searchDistance ? searchDistance : 100, // default: 100
maxPatternLength: 32,