Skip to content

Commit ee72dd0

Browse files
authored
feat: add logo option, #264 (#541)
1 parent 6c7ebc9 commit ee72dd0

File tree

6 files changed

+192
-142
lines changed

6 files changed

+192
-142
lines changed

docs/configuration.md

+61-51
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ You can configure the `window.$docsify`.
1414

1515
## el
1616

17-
* Type: `String`
18-
* Default: `#app`
17+
- Type: `String`
18+
- Default: `#app`
1919

2020
The DOM element to be mounted on initialization. It can be a CSS selector string or an actual HTMLElement.
2121

@@ -27,8 +27,8 @@ window.$docsify = {
2727

2828
## repo
2929

30-
* Type: `String`
31-
* Default: `null`
30+
- Type: `String`
31+
- Default: `null`
3232

3333
Configure the repository url or a string of `username/repo` can add the [GitHub Corner](http://tholman.com/github-corners/) widget in the top right corner of the site.
3434

@@ -42,8 +42,8 @@ window.$docsify = {
4242

4343
## maxLevel
4444

45-
* Type: `Number`
46-
* Default: `6`
45+
- Type: `Number`
46+
- Default: `6`
4747

4848
Maximum Table of content level.
4949

@@ -55,8 +55,8 @@ window.$docsify = {
5555

5656
## loadNavbar
5757

58-
* Type: `Boolean|String`
59-
* Default: `false`
58+
- Type: `Boolean|String`
59+
- Default: `false`
6060

6161
Loads navbar from the Markdown file `_navbar.md` if **true**, or else from the path specified.
6262

@@ -72,8 +72,8 @@ window.$docsify = {
7272

7373
## loadSidebar
7474

75-
* Type: `Boolean|String`
76-
* Default: `false`
75+
- Type: `Boolean|String`
76+
- Default: `false`
7777

7878
Loads sidebar from the Markdown file `_sidebar.md` if **true**, or else from the path specified.
7979

@@ -89,8 +89,8 @@ window.$docsify = {
8989

9090
## subMaxLevel
9191

92-
* Type: `Number`
93-
* Default: `0`
92+
- Type: `Number`
93+
- Default: `0`
9494

9595
Add table of contents (TOC) in custom sidebar.
9696

@@ -102,8 +102,8 @@ window.$docsify = {
102102

103103
## auto2top
104104

105-
* Type: `Boolean`
106-
* Default: `false`
105+
- Type: `Boolean`
106+
- Default: `false`
107107

108108
Scrolls to the top of the screen when the route is changed.
109109

@@ -115,8 +115,8 @@ window.$docsify = {
115115

116116
## homepage
117117

118-
* Type: `String`
119-
* Default: `README.md`
118+
- Type: `String`
119+
- Default: `README.md`
120120

121121
`README.md` in your docs folder will be treated as homepage for your website, but sometimes you may need to serve another file as your homepage.
122122

@@ -133,7 +133,7 @@ window.$docsify = {
133133

134134
## basePath
135135

136-
* Type: `String`
136+
- Type: `String`
137137

138138
Base path of the website. You can set it to another directory or another domain name.
139139

@@ -152,8 +152,8 @@ window.$docsify = {
152152

153153
## coverpage
154154

155-
* Type: `Boolean|String|String[]|Object`
156-
* Default: `false`
155+
- Type: `Boolean|String|String[]|Object`
156+
- Default: `false`
157157

158158
Activate the [cover feature](cover.md). If true, it will load from `_coverpage.md`.
159159

@@ -175,9 +175,21 @@ window.$docsify = {
175175
};
176176
```
177177

178+
## logo
179+
180+
- Type: `String`
181+
182+
Website logo as it appears in the sidebar, you can resize by CSS.
183+
184+
```js
185+
window.$docsify = {
186+
logo: '/_media/icon.svg'
187+
};
188+
```
189+
178190
## name
179191

180-
* Type: `String`
192+
- Type: `String`
181193

182194
Website name as it appears in the sidebar.
183195

@@ -189,8 +201,8 @@ window.$docsify = {
189201

190202
## nameLink
191203

192-
* Type: `String`
193-
* Default: `window.location.pathname`
204+
- Type: `String`
205+
- Default: `window.location.pathname`
194206

195207
The name of the link.
196208

@@ -208,7 +220,7 @@ window.$docsify = {
208220

209221
## markdown
210222

211-
* Type: `Function`
223+
- Type: `Function`
212224

213225
See [Markdown configuration](markdown.md).
214226

@@ -234,7 +246,7 @@ window.$docsify = {
234246

235247
## themeColor
236248

237-
* Type: `String`
249+
- Type: `String`
238250

239251
Customize the theme color. Use [CSS3 variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables) feature and polyfill in old browser.
240252

@@ -246,7 +258,7 @@ window.$docsify = {
246258

247259
## alias
248260

249-
* Type: `Object`
261+
- Type: `Object`
250262

251263
Set the route alias. You can freely manage routing rules. Supports RegExp.
252264

@@ -264,7 +276,7 @@ window.$docsify = {
264276

265277
## autoHeader
266278

267-
* type: `Boolean`
279+
- type: `Boolean`
268280

269281
If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.md`, prepend a header to the page before converting it to html. Compare [#78](https://github.com/QingWei-Li/docsify/issues/78).
270282

@@ -277,7 +289,7 @@ window.$docsify = {
277289

278290
## executeScript
279291

280-
* type: `Boolean`
292+
- type: `Boolean`
281293

282294
Execute the script on the page. Only parse the first script tag([demo](themes)). If Vue is present, it is turned on by default.
283295

@@ -299,7 +311,7 @@ Note that if you are running an external script, e.g. an embedded jsfiddle demo,
299311

300312
## noEmoji
301313

302-
* type: `Boolean`
314+
- type: `Boolean`
303315

304316
Disabled emoji parse.
305317

@@ -311,7 +323,7 @@ window.$docsify = {
311323

312324
## mergeNavbar
313325

314-
* type: `Boolean`
326+
- type: `Boolean`
315327

316328
Navbar will be merged with the sidebar on smaller screens.
317329

@@ -323,7 +335,7 @@ window.$docsify = {
323335

324336
## formatUpdated
325337

326-
* type: `String|Function`
338+
- type: `String|Function`
327339

328340
We can display the file update date through **{docsify-updated<span>}</span>** variable. And format it by `formatUpdated`.
329341
See https://github.com/lukeed/tinydate#patterns
@@ -342,8 +354,8 @@ window.$docsify = {
342354

343355
## externalLinkTarget
344356

345-
* type: `String`
346-
* default: `_blank`
357+
- type: `String`
358+
- default: `_blank`
347359

348360
Target to open external links. Default `'_blank'` (new window/tab)
349361

@@ -355,8 +367,8 @@ window.$docsify = {
355367

356368
## routerMode
357369

358-
* type: `String`
359-
* default: `history`
370+
- type: `String`
371+
- default: `history`
360372

361373
```js
362374
window.$docsify = {
@@ -366,7 +378,7 @@ window.$docsify = {
366378

367379
## noCompileLinks
368380

369-
* type: `Array`
381+
- type: `Array`
370382

371383
Sometimes we do not want docsify to handle our links. See [#203](https://github.com/QingWei-Li/docsify/issues/203)
372384

@@ -378,7 +390,7 @@ window.$docsify = {
378390

379391
## onlyCover
380392

381-
* type: `Boolean`
393+
- type: `Boolean`
382394

383395
Only coverpage is loaded when visiting the home page.
384396

@@ -390,7 +402,7 @@ window.$docsify = {
390402

391403
## requestHeaders
392404

393-
* type: `Object`
405+
- type: `Object`
394406

395407
Set the request resource headers.
396408

@@ -404,7 +416,7 @@ window.$docsify = {
404416

405417
## ext
406418

407-
* type: `String`
419+
- type: `String`
408420

409421
Request file extension.
410422

@@ -416,53 +428,51 @@ window.$docsify = {
416428

417429
## fallbackLanguages
418430

419-
* type: `Array<string>`
431+
- type: `Array<string>`
420432

421433
List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
422434

423435
Example:
424436

425-
- try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
426-
- then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
427-
- then display 404 page.
428-
437+
- try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
438+
- then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
439+
- then display 404 page.
429440

430441
```js
431442
window.$docsify = {
432-
fallbackLanguages: [
433-
"fr",
434-
"de"
435-
]
443+
fallbackLanguages: ['fr', 'de']
436444
};
437445
```
438446

439-
440447
## notFoundPage
441448

442-
* type: `Boolean` | `String` | `Object`
449+
- type: `Boolean` | `String` | `Object`
443450

444451
Load the `_404.md` file:
452+
445453
```js
446454
window.$docsify = {
447455
notFoundPage: true
448456
};
449457
```
450458

451459
Load the customised path of the 404 page:
460+
452461
```js
453462
window.$docsify = {
454463
notFoundPage: 'my404.md'
455464
};
456465
```
457466

458467
Load the right 404 page according to the localisation:
468+
459469
```js
460470
window.$docsify = {
461471
notFoundPage: {
462472
'/': '_404.md',
463-
'/de': 'de/_404.md',
473+
'/de': 'de/_404.md'
464474
}
465475
};
466476
```
467-
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
468477

478+
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.

0 commit comments

Comments
 (0)