docsify/docs/cover.md

98 lines
1.8 KiB
Markdown
Raw Normal View History

2017-02-13 22:43:58 +08:00
# Cover
Activate the cover feature by setting `coverpage` to **true**. See [coverpage configuration](configuration.md#coverpage).
2017-02-13 22:43:58 +08:00
## Basic usage
Set `coverpage` to **true**, and create a `_coverpage.md`:
2017-02-13 22:43:58 +08:00
```html
<!-- index.html -->
2017-02-13 22:43:58 +08:00
<script>
window.$docsify = {
coverpage: true
}
</script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
2017-02-13 22:43:58 +08:00
```
```markdown
<!-- _coverpage.md -->
2017-02-13 22:43:58 +08:00
![logo](_media/icon.svg)
2017-03-10 05:19:07 +08:00
# docsify <small>3.5</small>
2017-02-13 22:43:58 +08:00
> A magical documentation site generator.
- Simple and lightweight
2018-10-31 22:17:55 +08:00
- No statically built html files
- Multiple themes
2017-02-13 22:43:58 +08:00
[GitHub](https://github.com/docsifyjs/docsify/)
[Get Started](#docsify)
2017-02-13 22:43:58 +08:00
```
## Custom background
2017-03-10 05:19:07 +08:00
The background color is generated randomly by default. You can customize the background color or a background image:
2017-02-13 22:43:58 +08:00
```markdown
<!-- _coverpage.md -->
2017-03-10 05:19:07 +08:00
# docsify <small>3.5</small>
2017-02-13 22:43:58 +08:00
[GitHub](https://github.com/docsifyjs/docsify/)
2017-02-13 22:43:58 +08:00
[Get Started](#quick-start)
<!-- background image -->
2018-02-11 20:12:07 +08:00
2017-02-13 22:43:58 +08:00
![](_media/bg.png)
2017-03-10 05:19:07 +08:00
2017-02-13 22:43:58 +08:00
<!-- background color -->
2018-02-11 20:12:07 +08:00
2017-02-13 22:43:58 +08:00
![color](#f0f0f0)
```
2018-02-11 20:12:07 +08:00
## Coverpage as homepage
2018-06-04 09:02:45 +08:00
Normally, the coverpage and the homepage appear at the same time. Of course, you can also separate the coverpage by [onlyCover option](configuration.md#onlycover).
2018-02-11 20:12:07 +08:00
## Multiple covers
If your docs site is in more than one language, it may be useful to set multiple covers.
For example, your docs structure is like this
```text
.
└── docs
├── README.md
├── guide.md
├── _coverpage.md
└── zh-cn
├── README.md
└── guide.md
└── _coverpage.md
```
Now, you can set
```js
window.$docsify = {
coverpage: ['/', '/zh-cn/']
};
```
Or a special file name
```js
window.$docsify = {
coverpage: {
'/': 'cover.md',
'/zh-cn/': 'cover.md'
}
};
```