Open ventz opened 11 months ago
Hi,
Would you consider adding Fuse search? (https://www.fusejs.io/getting-started/installation.html)
See PaperMod theme for a very simple implementation: https://github.com/adityatelange/hugo-PaperMod
There are 2 files:
PaperMod/assets/js/fuse.basic.min.js /jane/assets/js/.
PaperMod/assets/js/fastsearch.js /jane/assets/js/.
Relevant section on how to use it: `PaperMod/layouts/partials/head.html
{{- /* Search */}} {{- if (eq .Layout `search`) -}} <link crossorigin="anonymous" rel="preload" as="fetch" href="../index.json"> {{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) | resources.Minify }} {{- $fusejs := resources.Get "js/fuse.basic.min.js" }} {{- $license_js := resources.Get "js/license.js" }} {{- if not site.Params.assets.disableFingerprinting }} {{- $search := (slice $fusejs $license_js $fastsearch ) | resources.Concat "assets/js/search.js" | fingerprint }} <script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}" integrity="{{ $search.Data.Integrity }}"></script> {{- else }} {{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" }} <script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}"></script> {{- end }} {{- end -}}
Assuming this may be an even faster approach: https://github.com/kaushalmodi/hugo-search-fuse-js
There is a good "how to" here too: https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae
Hi,
Would you consider adding Fuse search? (https://www.fusejs.io/getting-started/installation.html)
See PaperMod theme for a very simple implementation: https://github.com/adityatelange/hugo-PaperMod
There are 2 files:
PaperMod/assets/js/fuse.basic.min.js /jane/assets/js/.
PaperMod/assets/js/fastsearch.js /jane/assets/js/.
Relevant section on how to use it: `PaperMod/layouts/partials/head.html