Fixed index.json not found error

index.json was 404 because it was actually in language folder. But was searching in root.
This commit is contained in:
Rahat Zaman 2020-06-30 16:21:14 +06:00
parent 2175f01297
commit fad80051e5
1 changed files with 1 additions and 3 deletions

View File

@ -553,8 +553,6 @@
// ========================== search ========================== // ========================== search ==========================
{{ $baseurl:= $.Site.BaseURL }}
var baseurl = JSON.parse({{ $baseurl | jsonify }});
{{ $permalink:= .Permalink }} {{ $permalink:= .Permalink }}
var permalink = JSON.parse({{ $permalink | jsonify }}); var permalink = JSON.parse({{ $permalink | jsonify }});
var searchResults = null; var searchResults = null;
@ -575,7 +573,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', "/{{ .Lang }}/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) {