You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration.md
+31-3
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Configuration
2
2
3
-
You can configure the `window.$docsify`.
3
+
You can configure Docsify by defining `window.$docsify` as an object:
4
4
5
5
```html
6
6
<script>
@@ -12,6 +12,24 @@ You can configure the `window.$docsify`.
12
12
</script>
13
13
```
14
14
15
+
The config can also be defined as a function, in which case the first arg is the Docsify `vm` instance. The function should return a config object. This can be useful for referencing `vm` in places like the markdown configuration:
16
+
17
+
```html
18
+
<script>
19
+
window.$docsify=function(vm) {
20
+
return {
21
+
markdown: {
22
+
renderer: {
23
+
code(code, lang) {
24
+
// ... use `vm` ...
25
+
},
26
+
},
27
+
},
28
+
};
29
+
};
30
+
</script>
31
+
```
32
+
15
33
## el
16
34
17
35
- Type: `String`
@@ -144,6 +162,16 @@ window.$docsify = {
144
162
};
145
163
```
146
164
165
+
If you have a link to the homepage in the sidebar and want it to be shown as active when accessing the root url, make sure to update your sidebar accordingly:
166
+
167
+
```markdown
168
+
- Sidebar
169
+
- [Home](/)
170
+
- [Another page](another.md)
171
+
```
172
+
173
+
For more details, see [#1131](https://github.com/docsifyjs/docsify/issues/1131).
174
+
147
175
## basePath
148
176
149
177
- Type: `String`
@@ -446,11 +474,11 @@ window.$docsify = {
446
474
- type: `String`
447
475
- default: `noopener`
448
476
449
-
Default `'noopener'` (no opener) prevents the newly opened external page (when [externalLinkTarget](#externallinktarget) is `'_blank'`) from having the ability to control our page. No `rel` is set when its not `'_blank'`.
477
+
Default `'noopener'` (no opener) prevents the newly opened external page (when [externalLinkTarget](#externallinktarget) is `'_blank'`) from having the ability to control our page. No `rel` is set when its not `'_blank'`. See [this post](https://mathiasbynens.github.io/rel-noopener/) for more information about why you may want to use this option.
0 commit comments