mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-31 03:45:24 +01:00 
			
		
		
		
	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"]
This commit is contained in:
		| @@ -23,6 +23,7 @@ function loadSearch() { | ||||
|                             'content' | ||||
|                         ] | ||||
|                     }; | ||||
|                     {{ if . }}options = {{ jsonify . }}{{ end }} // load custom options from .Site.Params.fuseOpts | ||||
|                     fuse = new Fuse(data, options); // build the index from the json file | ||||
|                 } | ||||
|             } else { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Aditya Telange
					Aditya Telange