diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-12-15 18:55:01 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-12-15 18:57:42 +0530 |
| commit | 77ff1e6b452ad64eeee5178667827323d0a1644d (patch) | |
| tree | 60c1a9df49125586c853e68e7666b81db0a4e538 /layouts | |
| parent | f9236d92af35640752a706c1d0ee51b66bea063b (diff) | |
search: introduce loading custom fusejs options from site config #134
* refer https://fusejs.io/api/options.html for opts
* keys used can be some, all or none from
["title", "permalink", "summary", "content"]
in config.yml, add fuseOpts as shown below =>
params:
fuseOpts:
isCaseSensitive: false
shouldSort: true
location: 0
distance: 1000
threshold: 0.4
minMatchCharLength: 0
keys: ["title", "permalink", "summary", "content"]
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/partials/head.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index f257b68..0583700 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -41,7 +41,7 @@ <!-- Search --> {{- if (eq .Layout `search`) -}} <link rel="preload" as="fetch" href="../index.json" crossOrigin="anonymous"> -{{- $fastsearch := resources.Get "js/fastsearch.js" }} +{{- $fastsearch := resources.Get "js/fastsearch.js" | resources.ExecuteAsTemplate "js/fastsearch.js" .Site.Params.fuseOpts }} {{- $fusejs := resources.Get "js/fuse.js" }} {{- if not .Site.Params.assets.disableFingerprinting }} {{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify | fingerprint }} |
