hugo-book-theme/assets/search-data.js

25 lines
564 B
JavaScript
Raw Normal View History

2019-07-16 14:34:02 +02:00
(function() {
const pages = [
{{ range $index, $page := .Site.Pages }}
{{- if and $index (gt $index 0) -}},{{- end }}
{
"idx": {{ $index }},
"href": "{{ $page.RelPermalink }}",
"title": "{{ partial "docs/title" $page }}",
"content": {{ $page.Plain | jsonify }}
}
{{- end -}}
];
window.bookSearch = {
pages: pages,
idx: lunr(function() {
2019-07-17 13:42:39 +02:00
this.ref("idx");
this.field("title", { boost: 10000 });
this.field("content");
2019-07-16 14:34:02 +02:00
pages.forEach(this.add, this);
}),
}
})();