Skip to content

Commit 9b218a1

Browse files
committed
feat: new option hideSidebar
1 parent d798a12 commit 9b218a1

File tree

2 files changed

+75
-50
lines changed

2 files changed

+75
-50
lines changed

docs/configuration.md

Lines changed: 53 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The DOM element to be mounted on initialization. It can be a CSS selector string
2222
```js
2323
window.$docsify = {
2424
el: '#app'
25-
};
25+
}
2626
```
2727

2828
## repo
@@ -37,7 +37,7 @@ window.$docsify = {
3737
repo: 'docsifyjs/docsify',
3838
// or
3939
repo: 'https://github.com/docsifyjs/docsify/'
40-
};
40+
}
4141
```
4242

4343
## maxLevel
@@ -50,7 +50,7 @@ Maximum Table of content level.
5050
```js
5151
window.$docsify = {
5252
maxLevel: 4
53-
};
53+
}
5454
```
5555

5656
## loadNavbar
@@ -67,7 +67,7 @@ window.$docsify = {
6767

6868
// load from nav.md
6969
loadNavbar: 'nav.md'
70-
};
70+
}
7171
```
7272

7373
## loadSidebar
@@ -84,9 +84,24 @@ window.$docsify = {
8484

8585
// load from summary.md
8686
loadSidebar: 'summary.md'
87-
};
87+
}
8888
```
8989

90+
## hideSidebar
91+
92+
- Type : `Boolean`
93+
- Default: `true`
94+
95+
This option will completely hide your sidebar and wont render any content of the side even .
96+
97+
````js
98+
window.$docsify = {
99+
100+
hideSidebar: true,
101+
102+
};
103+
104+
90105
## subMaxLevel
91106

92107
- Type: `Number`
@@ -98,7 +113,7 @@ Add table of contents (TOC) in custom sidebar.
98113
window.$docsify = {
99114
subMaxLevel: 2
100115
};
101-
```
116+
````
102117
103118
## auto2top
104119
@@ -110,7 +125,7 @@ Scrolls to the top of the screen when the route is changed.
110125
```js
111126
window.$docsify = {
112127
auto2top: true
113-
};
128+
}
114129
```
115130

116131
## homepage
@@ -128,7 +143,7 @@ window.$docsify = {
128143
// Or use the readme in your repo
129144
homepage:
130145
'https://raw.githubusercontent.com/docsifyjs/docsify/master/README.md'
131-
};
146+
}
132147
```
133148

134149
## basePath
@@ -147,7 +162,7 @@ window.$docsify = {
147162
// Even can load files from other repo
148163
basePath:
149164
'https://raw.githubusercontent.com/ryanmcdermott/clean-code-javascript/master/'
150-
};
165+
}
151166
```
152167

153168
## relativePath
@@ -187,7 +202,7 @@ window.$docsify = {
187202
188203
// Relative path disabled (default value)
189204
relativePath: false
190-
};
205+
}
191206
```
192207

193208
## coverpage
@@ -212,7 +227,7 @@ window.$docsify = {
212227
'/': 'cover.md',
213228
'/zh-cn/': 'cover.md'
214229
}
215-
};
230+
}
216231
```
217232

218233
## logo
@@ -224,7 +239,7 @@ Website logo as it appears in the sidebar, you can resize by CSS.
224239
```js
225240
window.$docsify = {
226241
logo: '/_media/icon.svg'
227-
};
242+
}
228243
```
229244

230245
## name
@@ -236,15 +251,15 @@ Website name as it appears in the sidebar.
236251
```js
237252
window.$docsify = {
238253
name: 'docsify'
239-
};
254+
}
240255
```
241256

242257
The name field can also contain custom HTML for easier customization:
243258

244259
```js
245260
window.$docsify = {
246261
name: '<span>docsify</span>'
247-
};
262+
}
248263
```
249264

250265
## nameLink
@@ -263,7 +278,7 @@ window.$docsify = {
263278
'/zh-cn/': '/zh-cn/',
264279
'/': '/'
265280
}
266-
};
281+
}
267282
```
268283

269284
## markdown
@@ -287,9 +302,9 @@ window.$docsify = {
287302
// function
288303
markdown: function(marked, renderer) {
289304
// ...
290-
return marked;
305+
return marked
291306
}
292-
};
307+
}
293308
```
294309

295310
## themeColor
@@ -301,7 +316,7 @@ Customize the theme color. Use [CSS3 variables](https://developer.mozilla.org/en
301316
```js
302317
window.$docsify = {
303318
themeColor: '#3F51B5'
304-
};
319+
}
305320
```
306321

307322
## alias
@@ -319,7 +334,7 @@ window.$docsify = {
319334
'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG',
320335
'/.*/_sidebar.md': '/_sidebar.md' // See #301
321336
}
322-
};
337+
}
323338
```
324339

325340
## autoHeader
@@ -332,7 +347,7 @@ If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.m
332347
window.$docsify = {
333348
loadSidebar: true,
334349
autoHeader: true
335-
};
350+
}
336351
```
337352

338353
## executeScript
@@ -344,7 +359,7 @@ Execute the script on the page. Only parse the first script tag([demo](themes)).
344359
```js
345360
window.$docsify = {
346361
executeScript: true
347-
};
362+
}
348363
```
349364

350365
```markdown
@@ -366,7 +381,7 @@ Disabled emoji parse.
366381
```js
367382
window.$docsify = {
368383
noEmoji: true
369-
};
384+
}
370385
```
371386

372387
## mergeNavbar
@@ -378,7 +393,7 @@ Navbar will be merged with the sidebar on smaller screens.
378393
```js
379394
window.$docsify = {
380395
mergeNavbar: true
381-
};
396+
}
382397
```
383398

384399
## formatUpdated
@@ -395,9 +410,9 @@ window.$docsify = {
395410
formatUpdated: function(time) {
396411
// ...
397412
398-
return time;
413+
return time
399414
}
400-
};
415+
}
401416
```
402417

403418
## externalLinkTarget
@@ -410,7 +425,7 @@ Target to open external links inside the markdown. Default `'_blank'` (new windo
410425
```js
411426
window.$docsify = {
412427
externalLinkTarget: '_self' // default: '_blank'
413-
};
428+
}
414429
```
415430

416431
## cornerExternalLinkTarget
@@ -423,7 +438,7 @@ Target to open external link at the top right corner. Default `'_blank'` (new wi
423438
```js
424439
window.$docsify = {
425440
cornerExternalLinkTarget: '_self' // default: '_blank'
426-
};
441+
}
427442
```
428443

429444
## externalLinkRel
@@ -436,7 +451,7 @@ Default `'noopener'` (no opener) prevents the newly opened external page (when [
436451
```js
437452
window.$docsify = {
438453
externalLinkTarget: '' // default: 'noopener'
439-
};
454+
}
440455
```
441456

442457
## routerMode
@@ -447,7 +462,7 @@ window.$docsify = {
447462
```js
448463
window.$docsify = {
449464
routerMode: 'history' // default: 'hash'
450-
};
465+
}
451466
```
452467

453468
## noCompileLinks
@@ -459,7 +474,7 @@ Sometimes we do not want docsify to handle our links. See [#203](https://github.
459474
```js
460475
window.$docsify = {
461476
noCompileLinks: ['/foo', '/bar/.*']
462-
};
477+
}
463478
```
464479

465480
## onlyCover
@@ -471,7 +486,7 @@ Only coverpage is loaded when visiting the home page.
471486
```js
472487
window.$docsify = {
473488
onlyCover: false
474-
};
489+
}
475490
```
476491

477492
## requestHeaders
@@ -485,7 +500,7 @@ window.$docsify = {
485500
requestHeaders: {
486501
'x-token': 'xxx'
487502
}
488-
};
503+
}
489504
```
490505

491506
Such as setting the cache
@@ -495,11 +510,9 @@ window.$docsify = {
495510
requestHeaders: {
496511
'cache-control': 'max-age=600'
497512
}
498-
};
513+
}
499514
```
500515

501-
502-
503516
## ext
504517

505518
- type: `String`
@@ -509,7 +522,7 @@ Request file extension.
509522
```js
510523
window.$docsify = {
511524
ext: '.md'
512-
};
525+
}
513526
```
514527

515528
## fallbackLanguages
@@ -527,7 +540,7 @@ Example:
527540
```js
528541
window.$docsify = {
529542
fallbackLanguages: ['fr', 'de']
530-
};
543+
}
531544
```
532545
533546
## notFoundPage
@@ -539,15 +552,15 @@ Load the `_404.md` file:
539552
```js
540553
window.$docsify = {
541554
notFoundPage: true
542-
};
555+
}
543556
```
544557
545558
Load the customised path of the 404 page:
546559
547560
```js
548561
window.$docsify = {
549562
notFoundPage: 'my404.md'
550-
};
563+
}
551564
```
552565
553566
Load the right 404 page according to the localisation:
@@ -558,7 +571,7 @@ window.$docsify = {
558571
'/': '_404.md',
559572
'/de': 'de/_404.md'
560573
}
561-
};
574+
}
562575
```
563576
564577
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.

0 commit comments

Comments
 (0)