Jsonify title in search as well

This commit is contained in:
Alex Shpak
2019-08-08 13:15:19 +02:00
parent b95fbf9750
commit df8d186d38
5 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -1,11 +1,11 @@
(function() {
const pages = [
{{ range $index, $page := .Site.Pages }}
{{- if and $index (gt $index 0) -}},{{- end }}
{{- if $index -}},{{- end }}
{
"idx": {{ $index }},
"href": "{{ $page.RelPermalink }}",
"title": "{{ partial "docs/title" $page }}",
"title": {{ (partial "docs/title" $page) | jsonify}},
"content": {{ $page.Plain | jsonify }}
}
{{- end -}}
@@ -15,7 +15,7 @@
pages: pages,
idx: lunr(function() {
this.ref("idx");
this.field("title", { boost: 10000 });
this.field("title");
this.field("content");
pages.forEach(this.add, this);