summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-plugin-lunr/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gitbook-plugin-lunr/index.js')
-rw-r--r--packages/gitbook-plugin-lunr/index.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/gitbook-plugin-lunr/index.js b/packages/gitbook-plugin-lunr/index.js
index abc345f..bdde8f6 100644
--- a/packages/gitbook-plugin-lunr/index.js
+++ b/packages/gitbook-plugin-lunr/index.js
@@ -41,7 +41,9 @@ module.exports = {
hooks: {
// Index each page
'page': function(page) {
- if (this.output.name != 'website' || !searchIndexEnabled || page.search === false) {
+ const search = page.attributes.search;
+
+ if (this.output.name != 'website' || !searchIndexEnabled || search === false) {
return page;
}
@@ -64,8 +66,8 @@ module.exports = {
}
var keywords = [];
- if (page.search) {
- keywords = page.search.keywords || [];
+ if (search) {
+ keywords = search.keywords || [];
}
// Add to index