mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-22 23:37:53 +00:00
search: wrong searchindex URL with multilang per server config #940
This commit is contained in:
parent
4ed15c8096
commit
4190479458
2 changed files with 4 additions and 3 deletions
|
@ -11,14 +11,15 @@
|
|||
{{- warnf "UNSUPPORTED usage of 'searchpage' output format found, remove it from your config; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/7/#7-0-0" }}
|
||||
{{- end }}
|
||||
{{- if not .Site.Params.disableSearchIndex }}
|
||||
{{- $url := path.Join .Site.LanguagePrefix (trim (or .Site.Params.searchIndexURL "searchindex.js") "/") }}
|
||||
{{- $url := trim (or .Site.Params.searchIndexURL "searchindex.js") "/" }}
|
||||
{{- $url = path.Join (path.Dir $url) (print (path.BaseName $url) "." .Language.Lang (path.Ext $url)) }}
|
||||
{{- 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 }};
|
||||
window.index_js_url={{ (printf "%s%s" $url $assetBusting) | relURL }};
|
||||
</script>
|
||||
{{- if not .Site.Params.disableSearchPage }}
|
||||
{{- with .Site.GetPage "_relearn_searchpage" }}
|
||||
|
|
|
@ -1 +1 @@
|
|||
7.0.1+fef9c630c4745054041e7a5bcd4e7a608c224308
|
||||
7.0.1+4ed15c8096764c75a97ef858bb3a4c0d784fe888
|
Loading…
Reference in a new issue