[bug fix] search index

fix #292
This commit is contained in:
zzossig 2020-06-30 21:59:54 +09:00
parent 2175f01297
commit 80f1143d9b
1 changed files with 6 additions and 4 deletions

View File

@ -557,6 +557,8 @@
var baseurl = JSON.parse({{ $baseurl | jsonify }}); var baseurl = JSON.parse({{ $baseurl | jsonify }});
{{ $permalink := .Permalink }} {{ $permalink := .Permalink }}
var permalink = JSON.parse({{ $permalink | jsonify }}); var permalink = JSON.parse({{ $permalink | jsonify }});
{{ $langprefix := $.Site.LanguagePrefix }}
var langprefix = JSON.parse({{ $langprefix | jsonify }});
var searchResults = null; var searchResults = null;
var searchMenu = null; var searchMenu = null;
var searchText = null; var searchText = null;
@ -575,7 +577,7 @@
if (enableSearch) { if (enableSearch) {
(function initFuse() { (function initFuse() {
var xhr = new XMLHttpRequest(); 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.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
xhr.onload = function () { xhr.onload = function () {
if (xhr.status === 200) { if (xhr.status === 200) {