Skip to content

Commit bedc262

Browse files
committed
docs: update alias fixed #372
1 parent 9d5f561 commit bedc262

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

docs/de-de/more-pages.md

+13
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@ Als Zweites erstellst du eine Datei namens `_sidebar.md`:
5353

5454
`_sidebar.md` wird in jedem Verzeichnislevel geladen. Sollte das aktuelle Verzeichnis keine Datei namens `_sidebar.md` haben, so sucht **docsify** in den übergeordneten Ordnern. Wenn du z.B. im Moment im Verzeichnis `/guide/quick-start` bist, so wird `_sidebar.md` von der Datei `/guide/_sidebar.md` geladen.
5555

56+
You can specify `alias` to avoid unnecessary fallback.
57+
58+
```html
59+
<script>
60+
window.$docsify = {
61+
loadSidebar: true,
62+
alias: {
63+
'/.*/_sidebar.md': '/_sidebar.md'
64+
}
65+
}
66+
</script>
67+
```
68+
5669
## Inhaltsverzeichnis
5770

5871
Eine angepasste Seitenleist kann auch automatisch ein Inhaltsverzeichnis generieren, indem ein `subMaxLevel` gesetzt wird, vergleiche [sub-max-level Einstellungen](configuration.md#sub-max-level).

docs/deploy.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ It is recommended that you save your files to the `./docs` subfolder of the `mas
1414

1515
![github pages](_images/deploy-github-pages.png)
1616

17-
!> You can also save files in the root directory and select `master branch`.
18-
!> You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch
17+
!> You can also save files in the root directory and select `master branch`.
18+
You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch
1919

2020
## GitLab Pages
2121

docs/more-pages.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,22 @@ You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignori
5353

5454
`_sidebar.md` is loaded from each level directory. If the current directory doesn't have `_sidebar.md`, it will fall back to the parent directory. If, for example, the current path is `/guide/quick-start`, the `_sidebar.md` will be loaded from `/guide/_sidebar.md`.
5555

56+
You can specify `alias` to avoid unnecessary fallback.
57+
58+
```html
59+
<script>
60+
window.$docsify = {
61+
loadSidebar: true,
62+
alias: {
63+
'/.*/_sidebar.md': '/_sidebar.md'
64+
}
65+
}
66+
</script>
67+
```
5668

5769
## Table of Contents
5870

59-
Once you've created `_sidebar.md`, the sidebar content is automatically generated based on the headers in the markdown files.
71+
Once you've created `_sidebar.md`, the sidebar content is automatically generated based on the headers in the markdown files.
6072

6173
A custom sidebar can also automatically generate a table of contents by setting a `subMaxLevel`, compare [sub-max-level configuration](configuration.md#sub-max-level).
6274

docs/zh-cn/more-pages.md

+13
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
4949

5050
`_sidebar.md` 的加载逻辑是从每层目录下获取文件,如果当前目录不存在该文件则回退到上一级目录。例如当前路径为 `/zh-cn/more-pages` 则从 `/zh-cn/_sidebar.md` 获取文件,如果不存在则从 `/_sidebar.md` 获取。
5151

52+
当然你也可以配置 `alias` 避免不必要的回退过程。
53+
54+
```html
55+
<script>
56+
window.$docsify = {
57+
loadSidebar: true,
58+
alias: {
59+
'/.*/_sidebar.md': '/_sidebar.md'
60+
}
61+
}
62+
</script>
63+
```
64+
5265
## 显示目录
5366

5467
自定义侧边栏同时也可以开启目录功能。设置 `subMaxLevel` 配置项,具体介绍见 [配置项#sub-max-level](zh-cn/configuration#sub-max-level)

0 commit comments

Comments
 (0)