From 4a23c4acf2951bbdaacb8874826d5d7f628f85eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=B7?= Date: Wed, 31 Oct 2018 12:43:46 +0000 Subject: [PATCH] feat: Add hideOtherSidebarContent option (#661) Allow user to configure whether or not to hide other sidebar content while showing searching results. Related issue: https://github.com/docsifyjs/docsify/issues/535 --- docs/plugins.md | 4 +++- src/core/render/tpl.js | 2 +- src/plugins/search/component.js | 26 ++++++++++++++++++++++++-- src/plugins/search/index.js | 4 +++- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index 2d1bcc6..ae4e466 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -37,7 +37,9 @@ By default, the hyperlink on the current page is recognized and the content is s }, // Headline depth, 1 - 6 - depth: 2 + depth: 2, + + hideOtherSidebarContent: false, // whether or not to hide other sidebar content } } diff --git a/src/core/render/tpl.js b/src/core/render/tpl.js index c1bfd4f..71f5652 100644 --- a/src/core/render/tpl.js +++ b/src/core/render/tpl.js @@ -36,7 +36,7 @@ export function main(config) { '' + '