mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 10:50:24 +00:00
parent
d4cbccdde0
commit
20136aa4e7
1 changed files with 5 additions and 3 deletions
|
@ -9,9 +9,11 @@
|
|||
{{- end }}
|
||||
{{- if not .Site.Params.disableSearchIndex }}
|
||||
{{- $url := path.Join .Site.LanguagePrefix (trim (or .Site.Params.searchIndexURL "searchindex.js") "/") }}
|
||||
{{- $templateres := resources.Get "_relearn_searchindex.js" }}
|
||||
{{- $resultres := $templateres | resources.ExecuteAsTemplate $url .Site.Home }}
|
||||
{{- /* the following code causes Hugo to generate our file - although it is in comments */}}<!-- {{ $resultres.RelPermalink }} -->
|
||||
{{- if .IsHome }}
|
||||
{{- $templateres := resources.Get "_relearn_searchindex.js" }}
|
||||
{{- $resultres := $templateres | resources.ExecuteAsTemplate $url .Site.Home }}
|
||||
{{- /* the following code causes Hugo to generate our file - although it is in comments */}}<!-- {{ $resultres.RelPermalink }} -->
|
||||
{{- end }}
|
||||
<script>
|
||||
window.index_js_url={{ (printf "%s%s" $url $assetBusting) | relLangURL }};
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue