From 1033afcac237ed6a5c8557dab219184332f3924f Mon Sep 17 00:00:00 2001 From: moonleg <93369181+moonleg@users.noreply.github.com> Date: Fri, 29 Oct 2021 16:34:03 +0200 Subject: [PATCH 01/14] Add danish translation (#611) --- i18n/da.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 i18n/da.yaml diff --git a/i18n/da.yaml b/i18n/da.yaml new file mode 100644 index 0000000..03b0abe --- /dev/null +++ b/i18n/da.yaml @@ -0,0 +1,28 @@ +- id: prev_page + translation: "Forrige Side" + +- id: next_page + translation: "Næste Side" + +- id: read_time + translation: + one: "1 min" + other: "{{ .Count }} min" + +- id: toc + translation: "Indholdsfortegnelse" + +- id: translations + translation: "Oversættelser" + +- id: home + translation: "Start" + +- id: edit_post + translation: "Rediger" + +- id: code_copy + translation: "kopier" + +- id: code_copied + translation: "kopieret!" From d81b87938bd6a6c7812f63a40871c6e7516b126e Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 30 Oct 2021 13:33:15 +0530 Subject: [PATCH 02/14] Fix `params.fuseOpts` being ignored by Fuse.js by implementing a map of lower case to camel case parameters fixes: #556 --- assets/js/fastsearch.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/assets/js/fastsearch.js b/assets/js/fastsearch.js index 586941b..ea11022 100644 --- a/assets/js/fastsearch.js +++ b/assets/js/fastsearch.js @@ -26,7 +26,21 @@ window.onload = function () { 'content' ] }; - if (params.fuseOpts) options = params.fuseOpts; + if (params.fuseOpts) { + options = { + isCaseSensitive: params.fuseOpts.iscasesensitive ? params.fuseOpts.iscasesensitive : false, + includeScore: params.fuseOpts.includescore ? params.fuseOpts.includescore : false, + includeMatches: params.fuseOpts.includematches ? params.fuseOpts.includematches : false, + minMatchCharLength: params.fuseOpts.minmatchcharlength ? params.fuseOpts.minmatchcharlength : 1, + shouldSort: params.fuseOpts.shouldsort ? params.fuseOpts.shouldsort : true, + findAllMatches: params.fuseOpts.findallmatches ? params.fuseOpts.findallmatches : false, + keys: params.fuseOpts.keys ? params.fuseOpts.keys : ['title', 'permalink', 'summary', 'content'], + location: params.fuseOpts.location ? params.fuseOpts.location : 0, + threshold: params.fuseOpts.threshold ? params.fuseOpts.threshold : 0.4, + distance: params.fuseOpts.distance ? params.fuseOpts.distance : 100, + ignoreLocation: params.fuseOpts.ignorelocation ? params.fuseOpts.ignorelocation : true + } + } fuse = new Fuse(data, options); // build the index from the json file } } else { From 5f1d92493b95551911c03a762a1fa178bf232448 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 30 Oct 2021 13:57:22 +0530 Subject: [PATCH 03/14] Avoid caching search input between navigation --- layouts/_default/search.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/_default/search.html b/layouts/_default/search.html index 5ac2a24..2349587 100644 --- a/layouts/_default/search.html +++ b/layouts/_default/search.html @@ -21,7 +21,8 @@