search: don't break JS in multilang setup if search is disabled #140

This commit is contained in:
Sören Weber 2021-11-04 19:26:30 +01:00
parent 8a90e237f3
commit 48b0a66d40
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
2 changed files with 5 additions and 5 deletions

View file

@ -1,4 +1,9 @@
<script>
var index_url={{ "index.json" | relLangURL }};
var root_url="/";
var baseUri=root_url.replace(/\/$/, '');
</script>
<nav id="sidebar" class="{{ if $.Site.Params.showVisitedLinks }}showVisitedLinks{{ end }}">
{{- $currentNode := . }}
{{- $showvisitedlinks := .Site.Params.showVisitedLinks }}

View file

@ -8,9 +8,4 @@
<script src="{{"js/auto-complete.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
{{ "<!-- hack to let hugo tell us how to get to the root when using relativeURLs, it needs to be called *url= for it to do its magic: -->" | safeHTML }}
{{ "<!-- https://github.com/gohugoio/hugo/blob/145b3fcce35fbac25c7033c91c1b7ae6d1179da8/transform/urlreplacers/absurlreplacer.go#L72 -->" | safeHTML }}
<script>
var index_url={{ "index.json" | relLangURL }};
var root_url="/";
var baseUri=root_url.replace(/\/$/, '');
</script>
<script src="{{ "js/search.js" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>