Skip to content

Commit b7547f1

Browse files
authored
feat: new option hideSidebar (#1026)
* feat: new option hideSidebar * chore: removed the console logs * chore: linting fixes * chore: test fix
1 parent 75c72e9 commit b7547f1

File tree

100 files changed

+194
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+194
-171
lines changed

cypress/integration/sidebar/config.spec.js

+123-122
Large diffs are not rendered by default.

docs/configuration.md

+59-48

src/core/render/index.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,18 @@ export function renderMixin(proto) {
9595
};
9696

9797
proto._renderSidebar = function(text) {
98-
const { maxLevel, subMaxLevel, loadSidebar } = this.config;
98+
const { maxLevel, subMaxLevel, loadSidebar, hideSidebar } = this.config;
99+
100+
if (hideSidebar) {
101+
// FIXME : better styling solution
102+
document.querySelector('aside.sidebar').remove();
103+
document.querySelector('button.sidebar-toggle').remove();
104+
document.querySelector('section.content').style.right = 'unset';
105+
document.querySelector('section.content').style.left = 'unset';
106+
document.querySelector('section.content').style.position = 'relative';
107+
document.querySelector('section.content').style.width = '100%';
108+
return null;
109+
}
99110

100111
this._renderTo('.sidebar-nav', this.compiler.sidebar(text, maxLevel));
101112
const activeEl = getAndActive(this.router, '.sidebar-nav', true, true);

0 commit comments

Comments
 (0)