aboutsummaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
Diffstat (limited to 'assets')
-rw-r--r--assets/search-data.js6
-rw-r--r--assets/search.js4
2 files changed, 7 insertions, 3 deletions
diff --git a/assets/search-data.js b/assets/search-data.js
index a3fd51b..9c7f6a9 100644
--- a/assets/search-data.js
+++ b/assets/search-data.js
@@ -2,8 +2,10 @@
(function() {
const indexCfg = {{ with .Site.Params.BookSearchConfig }}
- {{ . }}
- {{ end }};
+ {{ . }};
+ {{ else }}
+ {};
+ {{ end }}
indexCfg.doc = {
id: 'id',
diff --git a/assets/search.js b/assets/search.js
index 89302b1..f21d4bf 100644
--- a/assets/search.js
+++ b/assets/search.js
@@ -1,6 +1,8 @@
'use strict';
-{{- $searchData := resources.Get "search-data.js" | resources.ExecuteAsTemplate "search-data.js" . | resources.Minify | resources.Fingerprint }}
+{{ $searchDataFile := printf "%s.%s" .Language.Lang "search-data.js" }}
+{{ $searchData := resources.Get "search-data.js" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify | resources.Fingerprint }}
+
(function() {
const input = document.querySelector('#book-search-input');
const results = document.querySelector('#book-search-results');