defaultContentLanguageInSubdir problem fixed

This commit is contained in:
zzossig 2019-12-24 23:59:52 +09:00
parent 2a0d8ca0bc
commit ea48d2b0d9
1 changed files with 9 additions and 3 deletions

View File

@ -13,13 +13,19 @@
<script>
// search
var baseurl = null;
var runSearch = function() {
{{ if .Site.IsMultiLingual }}
var baseurl = location.origin + "/{{.Site.Language.Lang}}";
var isSubDirDisabled = location.pathname.startsWith("/{{.Site.Language.Lang}}");
if (isSubDirDisabled) {
baseurl = location.origin + "/{{.Site.Language.Lang}}";
} else {
baseurl = location.origin;
}
{{ else }}
var baseurl = location.origin;
baseurl = location.origin;
{{ end }}
var searchResults = null;
var searchMenu = null;
var fuse = null;