Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zzossig/hugo-theme-zzo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzzossig <zzossig@gmail.com>2020-06-30 15:59:54 +0300
committerzzossig <zzossig@gmail.com>2020-06-30 15:59:54 +0300
commit80f1143d9bffc4a7d705cb79a2a12983bc92ee50 (patch)
treec3f0207f984786040088680a94c2403b0ced421e
parent2175f012974f8ade6afe47cc2d641bb742937b28 (diff)
[bug fix] search index
fix #292
-rw-r--r--layouts/partials/head/scripts.html10
1 files changed, 6 insertions, 4 deletions
diff --git a/layouts/partials/head/scripts.html b/layouts/partials/head/scripts.html
index 947d459..a42727a 100644
--- a/layouts/partials/head/scripts.html
+++ b/layouts/partials/head/scripts.html
@@ -553,10 +553,12 @@
// ========================== search ==========================
- {{ $baseurl:= $.Site.BaseURL }}
+ {{ $baseurl := $.Site.BaseURL }}
var baseurl = JSON.parse({{ $baseurl | jsonify }});
- {{ $permalink:= .Permalink }}
+ {{ $permalink := .Permalink }}
var permalink = JSON.parse({{ $permalink | jsonify }});
+ {{ $langprefix := $.Site.LanguagePrefix }}
+ var langprefix = JSON.parse({{ $langprefix | jsonify }});
var searchResults = null;
var searchMenu = null;
var searchText = null;
@@ -571,11 +573,11 @@
var sectionType = JSON.parse({{ $sectionType | jsonify }});
var fuse = null;
-
+
if (enableSearch) {
(function initFuse() {
var xhr = new XMLHttpRequest();
- xhr.open('GET', baseurl + "/index.json");
+ xhr.open('GET', baseurl + langprefix + "/index.json");
xhr.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
xhr.onload = function () {
if (xhr.status === 200) {