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

github.com/zzossig/hugo-theme-zdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzzossig <zzossig@gmail.com>2020-03-10 03:49:30 +0300
committerzzossig <zzossig@gmail.com>2020-03-10 03:49:30 +0300
commit8cdd6df08e300fa1116ae18f57512fb11d90ae49 (patch)
tree091d438d85482207f82baa0c956838e6f179a5ad
parentb640731190a9e0c7b64f9c77efd8d41be980bdce (diff)
make less search indexes
-rw-r--r--exampleSite/config/_default/config.toml3
-rw-r--r--layouts/partials/head/scripts.html8
2 files changed, 4 insertions, 7 deletions
diff --git a/exampleSite/config/_default/config.toml b/exampleSite/config/_default/config.toml
index a34be73..3a3fc6d 100644
--- a/exampleSite/config/_default/config.toml
+++ b/exampleSite/config/_default/config.toml
@@ -33,10 +33,7 @@ disableKinds = ["taxonomyTerm"]
startLevel = 2
[outputs]
- page = ["HTML", "SearchIndex"]
home = ["HTML", "RSS", "SearchIndex"]
- section = ["HTML", "RSS", "SearchIndex"]
- taxonomy = ["HTML", "RSS", "SearchIndex"]
[outputFormats]
[outputFormats.SearchIndex]
diff --git a/layouts/partials/head/scripts.html b/layouts/partials/head/scripts.html
index c2b2f9c..6fa78c1 100644
--- a/layouts/partials/head/scripts.html
+++ b/layouts/partials/head/scripts.html
@@ -452,12 +452,12 @@
}
});
}) : null;
- // ============================================================
+ // ============================================================
// ========================== search ==========================
- {{ $permalink:= .Permalink }}
- var permalink = JSON.parse({{ $permalink | jsonify }});
+ {{ $searchURL:= ("/" | absLangURL) }}
+ var searchURL = JSON.parse({{ $searchURL | jsonify }});
var searchResults = null;
var searchMenu = null;
var searchText = null;
@@ -472,7 +472,7 @@
if (enableSearch) {
(function initFuse() {
var xhr = new XMLHttpRequest();
- xhr.open('GET', permalink + "index.json");
+ xhr.open('GET', searchURL + "index.json");
xhr.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
xhr.onload = function () {
if (xhr.status === 200) {