mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-30 19:35:26 +01:00 
			
		
		
		
	fix wrong load stylesheet and JS on multihost (multilingual) #126
This commit is contained in:
		| @@ -21,11 +21,11 @@ | ||||
| {{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }} | ||||
| {{- if not .Site.Params.assets.disableFingerprinting }} | ||||
| {{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint }} | ||||
| <script defer src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}" | ||||
| <script defer src="{{ $highlight.RelPermalink | absLangURL }}" integrity="{{ $highlight.Data.Integrity }}" | ||||
|     onload="hljs.initHighlightingOnLoad();"></script> | ||||
| {{- else}} | ||||
| {{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify }} | ||||
| <script defer src="{{ $highlight.RelPermalink }}" onload="hljs.initHighlightingOnLoad();"></script> | ||||
| <script defer src="{{ $highlight.RelPermalink | absLangURL }}" onload="hljs.initHighlightingOnLoad();"></script> | ||||
| {{- end}} | ||||
| {{- end }} | ||||
| <script> | ||||
|   | ||||
| @@ -29,10 +29,10 @@ | ||||
|  | ||||
| {{- if not .Site.Params.assets.disableFingerprinting }} | ||||
| {{- $stylesheet := $stylesheet | fingerprint -}} | ||||
| <link href="{{ $stylesheet.RelPermalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet" | ||||
| <link href="{{ $stylesheet.RelPermalink | absLangURL }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet" | ||||
|     as="style"> | ||||
| {{- else}} | ||||
| <link href="{{ $stylesheet.RelPermalink }}" rel="preload stylesheet" as="style"> | ||||
| <link href="{{ $stylesheet.RelPermalink | absLangURL }}" rel="preload stylesheet" as="style"> | ||||
| {{- end}} | ||||
| <!-- Search --> | ||||
| {{- if (eq .Layout `search`) -}} | ||||
| @@ -41,10 +41,10 @@ | ||||
| {{- $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 src="{{ $search.RelPermalink }}" onload="loadSearch();" integrity="{{ $search.Data.Integrity }}"></script> | ||||
| <script defer src="{{ $search.RelPermalink | absLangURL }}" onload="loadSearch();" integrity="{{ $search.Data.Integrity }}"></script> | ||||
| {{- else}} | ||||
| {{ $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }} | ||||
| <script defer src="{{ $search.RelPermalink }}" onload="loadSearch();"></script> | ||||
| <script defer src="{{ $search.RelPermalink | absLangURL }}" onload="loadSearch();"></script> | ||||
| {{- end}} | ||||
| {{- end -}} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Aditya Telange
					Aditya Telange