1.0 features (#21)
* feat: hash routing, close #2 * Fix router bug * Remove console * Add hash router docs * Improved scrolling on mobile * Add change log * Use hash router
This commit is contained in:
parent
b977715d42
commit
864935bfc1
15 changed files with 174 additions and 60 deletions
|
|
@ -213,8 +213,10 @@ If you write a sub level list, it will generate a dropdown list.
|
|||
- [chinese](/zh-cn)
|
||||
```
|
||||
|
||||
## FAQ
|
||||
### router
|
||||
|
||||
### Why use `404.html` instead of `index.html`
|
||||
Hash router. You can replace `404.html` with `index.html`.
|
||||
|
||||
[issues/7](https://github.com/QingWei-Li/docsify/issues/7)
|
||||
```html
|
||||
<script src="/lib/docsify.js" data-router></script>
|
||||
```
|
||||
|
|
|
|||
|
|
@ -18,5 +18,6 @@
|
|||
src="//unpkg.com/docsify/lib/docsify.min.js"
|
||||
data-repo="qingwei-li/docsify"
|
||||
data-max-level="3"
|
||||
data-sidebar-toggle></script>
|
||||
data-sidebar-toggle
|
||||
data-router></script>
|
||||
</html>
|
||||
|
|
@ -97,6 +97,10 @@ docsify serve docs
|
|||
</nav>
|
||||
```
|
||||
|
||||
### CDN
|
||||
|
||||
目前可用的 CDN 有 [UNPKG](unpkg.com/docsify),如果觉得访问较慢可以将文件放到 Pages 的目录下。
|
||||
|
||||
### 配置参数
|
||||
|
||||
#### repo
|
||||
|
|
@ -210,6 +214,14 @@ Sidebar 开关按钮
|
|||
```
|
||||
|
||||
|
||||
### router
|
||||
|
||||
开启 hash router 功能,此时可以创建 `index.html` 作为入口文件,同时多页面切换不会重新加载资源。资源路径会被替换成 `/#/` 的形式。
|
||||
|
||||
```html
|
||||
<script src="/lib/docsify.js" data-router></script>
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
### 为什么是 `404.html` 而不用 `index.html`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue