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,11 +13,17 @@
<script> <script>
// search // search
var baseurl = null;
var runSearch = function() { var runSearch = function() {
{{ if .Site.IsMultiLingual }} {{ 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 }} {{ else }}
var baseurl = location.origin; baseurl = location.origin;
{{ end }} {{ end }}
var searchResults = null; var searchResults = null;