diff options
author | Steven Mathew <ste.tho.mat@gmail.com> | 2022-04-30 19:55:56 +0300 |
---|---|---|
committer | Steven Mathew <ste.tho.mat@gmail.com> | 2022-04-30 19:55:56 +0300 |
commit | 10f8c8ea002ad35b259e5f4cadb901793fe7bcb6 (patch) | |
tree | 08963f68f7f058a520ca7777626e1d42e6a6902e | |
parent | 7c834a5a11858f8eb47fca558d3eb620589f1275 (diff) |
fix(flexsearch): separate chain of calls into statements
-rw-r--r-- | assets/js/index.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/assets/js/index.js b/assets/js/index.js index b99ab90..f3d8da1 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -97,8 +97,8 @@ Source: {{ $list := (where .Site.Pages "Section" "docs") -}} {{ $len := (len $list) -}} - index.add( - {{ range $index, $element := $list -}} + {{ range $index, $element := $list -}} + index.add( { id: {{ $index }}, href: "{{ .RelPermalink }}", @@ -109,12 +109,9 @@ Source: description: {{ .Summary | plainify | jsonify }}, {{ end -}} content: {{ .Plain | jsonify }} - }) - {{ if ne (add $index 1) $len -}} - .add( - {{ end -}} - {{ end -}} - ; + } + ); + {{ end -}} search.addEventListener('input', show_results, true); |