Init search index before make it

This commit is contained in:
zzossig 2020-02-11 21:26:28 +09:00
parent 2cf3ecf406
commit b17da60cb1
6 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,4 @@
{{ .Scratch.Delete "searchindex" }}
{{- $.Scratch.Add "searchindex" slice -}}
{{ if eq .Type "publication" }}

View File

@ -1,3 +1,4 @@
{{ .Scratch.Delete "searchindex" }}
{{- $.Scratch.Add "searchindex" slice -}}
{{- range $index, $element := (where .Site.RegularPages "Kind" "page") -}}
{{ with $element.Plain }}

View File

@ -1,3 +1,4 @@
{{ .Scratch.Delete "searchindex" }}
{{- $.Scratch.Add "searchindex" slice -}}
{{- range $index, $element := (where .Site.RegularPages "Kind" "page") -}}
{{ with $element.Plain }}

View File

@ -1,3 +1,4 @@
{{ .Scratch.Delete "searchindex" }}
{{- $.Scratch.Add "searchindex" slice -}}
{{- range $index, $element := (where .Site.RegularPages "Kind" "page") -}}
{{ with $element.Plain }}

View File

@ -1,3 +1,4 @@
{{ .Scratch.Delete "searchindex" }}
{{- $.Scratch.Add "searchindex" slice -}}
{{- range $index, $element := (where .Site.RegularPages "Kind" "page") -}}
{{ with $element.Plain }}

View File

@ -857,7 +857,7 @@
searchText = e.target.value;
var results = fuse.search(e.target.value);
if (searchResultPosition === "main") {
if (enableSearchHighlight) {
renderSearchHighlightResultsMain(searchText, results);