Skip to content

Commit 7fb5ce6

Browse files
committed
docs: add alias
1 parent c4aa22c commit 7fb5ce6

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

docs/configuration.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,12 @@ window.$docsify = {
250250

251251
- Type: `Object`
252252

253-
Set the route alias. You can freely manage routing rules.
253+
Set the route alias. You can freely manage routing rules. Supports RegExp.
254254

255255
```js
256256
window.$docsify = {
257257
alias: {
258+
'/foo/(+*)': '/bar/$1', // supports regexp
258259
'/zh-cn/changelog': '/changelog',
259260
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
260261
}
@@ -298,6 +299,8 @@ Note that if you are running an external script, e.g. an embedded jsfiddle demo,
298299

299300
## no-emoji
300301

302+
- type: `Boolean`
303+
301304
Disabled emoji parse.
302305

303306
```js
@@ -308,6 +311,8 @@ window.$docsify = {
308311

309312
## merge-navbar
310313

314+
- type: `Boolean`
315+
311316
Navbar will be merged with the sidebar on smaller screens.
312317

313318
```js
@@ -317,6 +322,9 @@ window.$docsify = {
317322
```
318323

319324
## format-updated
325+
326+
- type: `String|Function`
327+
320328
We can display the file update date through **{docsify-updated<span>}</span>** variable. And format it by `formatUpdated`.
321329
See https://github.com/lukeed/tinydate#patterns
322330
```js
@@ -333,6 +341,9 @@ window.$docsify = {
333341

334342
## external-link-target
335343

344+
- type: `String`
345+
- default: `_self`
346+
336347
Target to open external links. Default `'_blank'` (new window/tab)
337348

338349
```js
@@ -342,6 +353,10 @@ window.$docsify = {
342353
```
343354

344355
## router-mode
356+
357+
- type: `String`
358+
- default: `history`
359+
345360
```js
346361
window.$docsify = {
347362
routerMode: 'history' // default: 'hash'

docs/de-de/configuration.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,12 @@ window.$docsify = {
250250

251251
- Typ: `Object`
252252

253-
Verwende alternative Routen. Du kannst sie ungehindert anpassen.
253+
Verwende alternative Routen. Du kannst sie ungehindert anpassen. Supports RegExp.
254254

255255
```js
256256
window.$docsify = {
257257
alias: {
258+
'/foo/(+*)': '/bar/$1', // supports regexp
258259
'/zh-cn/changelog': '/changelog',
259260
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
260261
}
@@ -317,7 +318,7 @@ window.$docsify = {
317318
```
318319

319320
## format-updated
320-
We can display the file update date through **{docsify-updated<span>}</span>** variable. And format it by `formatUpdated`.
321+
We can display the file update date through **{docsify-updated<span>}</span>** variable. And format it by `formatUpdated`.
321322
See https://github.com/lukeed/tinydate#patterns
322323
```js
323324
window.$docsify = {

docs/index.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
<script>
2424
window.$docsify = {
2525
alias: {
26-
'/de-de/changelog': '/changelog',
27-
'/zh-cn/changelog': '/changelog',
28-
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
26+
'.*?/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
2927
},
3028
auto2top: true,
3129
coverpage: true,

docs/zh-cn/configuration.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,13 @@ window.$docsify = {
258258

259259
- 类型:`Object`
260260

261-
定义路由别名,可以更自由的定义路由规则。
261+
定义路由别名,可以更自由的定义路由规则。 支持正则。
262262

263263

264264
```js
265265
window.$docsify = {
266266
alias: {
267+
'/foo/(+*)': '/bar/$1', // supports regexp
267268
'/zh-cn/changelog': '/changelog',
268269
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
269270
}
@@ -327,7 +328,8 @@ window.$docsify = {
327328
```
328329

329330
## format-updated
330-
我们可以显示文档更新日期通过 **{docsify-updated<span>}</span>** 变量. 并且格式化日期通过 `formatUpdated`.
331+
332+
我们可以显示文档更新日期通过 **{docsify-updated<span>}</span>** 变量. 并且格式化日期通过 `formatUpdated`.
331333
参考 https://github.com/lukeed/tinydate#patterns
332334
```js
333335
window.$docsify = {

0 commit comments

Comments
 (0)