mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-30 19:35:26 +01:00 
			
		
		
		
	Use js.Build to fetch fuseOpts;
also load Search on window load
This commit is contained in:
		| @@ -61,14 +61,14 @@ | ||||
| {{- /* Search */}} | ||||
| {{- if (eq .Layout `search`) -}} | ||||
| <link crossorigin="anonymous" rel="preload" as="fetch" href="../index.json"> | ||||
| {{- $fastsearch := resources.Get "js/fastsearch.js" | resources.ExecuteAsTemplate "js/fastsearch.js" .Site.Params.fuseOpts }} | ||||
| {{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" .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 }} | ||||
| <script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}" onload="loadSearch();" integrity="{{ $search.Data.Integrity }}"></script> | ||||
| <script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}" integrity="{{ $search.Data.Integrity }}"></script> | ||||
| {{- else }} | ||||
| {{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }} | ||||
| <script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}" onload="loadSearch();"></script> | ||||
| <script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}"></script> | ||||
| {{- end }} | ||||
| {{- end -}} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Aditya Telange
					Aditya Telange