docs: add mutiple covers
This commit is contained in:
parent
bd7ee84241
commit
4bdcee2cb3
12 changed files with 262 additions and 93 deletions
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
封面的生成同样是从 markdown 文件渲染来的。开启渲染封面功能后在文档根目录创建 `_coverpage.md` 文件。渲染效果如本文档。
|
||||
|
||||
*index.html*
|
||||
_index.html_
|
||||
|
||||
```html
|
||||
<script>
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
<script src="//unpkg.com/docsify"></script>
|
||||
```
|
||||
|
||||
*_coverpage.md*
|
||||
_\_coverpage.md_
|
||||
|
||||
```markdown
|
||||

|
||||
|
|
@ -26,24 +26,21 @@
|
|||
|
||||
> A magical documentation site generator.
|
||||
|
||||
- Simple and lightweight (~12kb gzipped)
|
||||
- Multiple themes
|
||||
- Not build static html files
|
||||
|
||||
* Simple and lightweight (~12kb gzipped)
|
||||
* Multiple themes
|
||||
* Not build static html files
|
||||
|
||||
[GitHub](https://github.com/QingWei-Li/docsify/)
|
||||
[Get Started](#quick-start)
|
||||
```
|
||||
|
||||
|
||||
|
||||
!> 一份文档只会在根目录下加载封面,其他页面或者二级目录下都不会加载。
|
||||
|
||||
## 自定义背景
|
||||
|
||||
目前的背景是随机生成的渐变色,我们自定义背景色或者背景图。在文档末尾用添加图片的 Markdown 语法设置背景。
|
||||
|
||||
*_coverpage.md*
|
||||
_\_coverpage.md_
|
||||
|
||||
```markdown
|
||||
# docsify
|
||||
|
|
@ -52,7 +49,51 @@
|
|||
[Get Started](#quick-start)
|
||||
|
||||
<!-- 背景图片 -->
|
||||
|
||||

|
||||
|
||||
<!-- 背景色 -->
|
||||
|
||||

|
||||
```
|
||||
|
||||
## 封面作为首页
|
||||
|
||||
通常封面和首页是同时出现的,当然你也是当封面独立出来通过设置[onlyCover 选项](zh-cn/configuration.md#onlycover)。
|
||||
|
||||
## 多个封面
|
||||
|
||||
如果你的文档网站是多语言的,或许你需要设置多个封面。
|
||||
|
||||
例如你的文档目录结构如下
|
||||
|
||||
```text
|
||||
.
|
||||
└── docs
|
||||
├── README.md
|
||||
├── guide.md
|
||||
├── _coverpage.md
|
||||
└── zh-cn
|
||||
├── README.md
|
||||
└── guide.md
|
||||
└── _coverpage.md
|
||||
```
|
||||
|
||||
那么你可以这么配置
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
coverpage: ['/', '/zh-cn/']
|
||||
};
|
||||
```
|
||||
|
||||
或者具体指名文件名
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
coverpage: {
|
||||
'/': 'cover.md',
|
||||
'/zh-cn/': 'cover.md'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue