diff options
author | Soreine <nicolas@gitbook.com> | 2016-10-18 16:36:46 +0200 |
---|---|---|
committer | Soreine <nicolas@gitbook.com> | 2016-10-18 16:40:49 +0200 |
commit | 59079bc18d5bdeb89cb7b8574cb29c66d30dc123 (patch) | |
tree | 57f1efeac06f5ee946feb3d8bef01d7277e97e04 /packages/gitbook-plugin-lunr/index.js | |
parent | 66c2a6c0764f106e312bcc8c04ba00c9e5044ea1 (diff) | |
download | gitbook-59079bc18d5bdeb89cb7b8574cb29c66d30dc123.zip gitbook-59079bc18d5bdeb89cb7b8574cb29c66d30dc123.tar.gz gitbook-59079bc18d5bdeb89cb7b8574cb29c66d30dc123.tar.bz2 |
plugin-lunr: Fix reading page search attributes
Diffstat (limited to 'packages/gitbook-plugin-lunr/index.js')
-rw-r--r-- | packages/gitbook-plugin-lunr/index.js | 8 |
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 |