更新文档结构,增加开发手册区域,新增API、主题开发文档
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
# Theme Config: Algolia Search
|
||||
|
||||
The `themeConfig.algolia` option allows you to use [Algolia DocSearch](https://docsearch.algolia.com). To enable it, you need to provide at least appId, apiKey and indexName:
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
themeConfig: {
|
||||
algolia: {
|
||||
appId: 'your_app_id',
|
||||
apiKey: 'your_api_key',
|
||||
indexName: 'index_name'
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For more options, check out [Algolia DocSearch's documentation](https://docsearch.algolia.com/docs/api/). You can pass any extra option alongside other options, e.g. passing `searchParameters`:
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
themeConfig: {
|
||||
algolia: {
|
||||
appId: 'your_app_id',
|
||||
apiKey: 'your_api_key',
|
||||
indexName: 'index_name',
|
||||
searchParameters: {
|
||||
facetFilters: ['tags:guide,api']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Internationalization (i18n)
|
||||
|
||||
If you have multiple locales in your documentation and you have defined a `locales` object in your `themeConfig`:
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
themeConfig: {
|
||||
locales: {
|
||||
// ...
|
||||
},
|
||||
algolia: {
|
||||
appId: 'your_app_id',
|
||||
apiKey: 'your_api_key',
|
||||
indexName: 'index_name'
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
VitePress will automatically add a `lang` _facetFilter_ to the `searchParameters.facetFilter` array with the correct language value. Algolia automatically adds the correct facet filter based on the `lang` attribute on the `<html>` tag. This will match search results with the currently viewed language of the page.
|
||||
@@ -1,59 +0,0 @@
|
||||
# App Config: Basics
|
||||
|
||||
::: tip
|
||||
The config reference is incomplete since the config format may still receive further changes. For a complete reference of the current available options, refer to [config.ts](https://github.com/vuejs/vitepress/blob/45b65ce8b63bd54f345bfc3383eb2416b6769dc9/src/node/config.ts#L30-L65).
|
||||
:::
|
||||
|
||||
## base
|
||||
|
||||
- Type: `string`
|
||||
- Default: `/`
|
||||
|
||||
The base URL the site will be deployed at. You will need to set this if you plan to deploy your site under a sub path, for example, GitHub pages. If you plan to deploy your site to `https://foo.github.io/bar/`, then you should set base to `'/bar/'`. It should always start and end with a slash.
|
||||
|
||||
The `base` is automatically prepended to all the URLs that start with `/` in other options, so you only need to specify it once.
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
base: '/base/'
|
||||
}
|
||||
```
|
||||
|
||||
## lang
|
||||
|
||||
- Type: `string`
|
||||
- Default: `en-US`
|
||||
|
||||
The `lang` attribute for the site. This will render as a `<html lang="en-US">` tag in the page HTML.
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
lang: 'en-US'
|
||||
}
|
||||
```
|
||||
|
||||
## title
|
||||
|
||||
- Type: `string`
|
||||
- Default: `VitePress`
|
||||
|
||||
Title for the site. This will be the suffix for all page titles, and displayed in the navbar.
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
title: 'VitePress'
|
||||
}
|
||||
```
|
||||
|
||||
## description
|
||||
|
||||
- Type: `string`
|
||||
- Default: `A VitePress site`
|
||||
|
||||
Description for the site. This will render as a `<meta>` tag in the page HTML.
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
description: 'A VitePress site'
|
||||
}
|
||||
```
|
||||
@@ -1,15 +0,0 @@
|
||||
# Theme Config: Carbon Ads
|
||||
|
||||
VitePress has built in native support for [Carbon Ads](https://www.carbonads.net). By defining the Carbon Ads credentials in config, VitePress will display ads on the page.
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
themeConfig: {
|
||||
carbonAds: {
|
||||
carbon: 'your-carbon-key',
|
||||
custom: 'your-carbon-custom',
|
||||
placement: 'your-carbon-placement'
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -1,23 +0,0 @@
|
||||
# Theme Config: Homepage
|
||||
|
||||
VitePress provides a homepage layout. To use it, specify `home: true` plus some other metadata in your root `index.md`'s YAML frontmatter. This is an example of how it works:
|
||||
|
||||
```yaml
|
||||
---
|
||||
home: true
|
||||
heroImage: /logo.png
|
||||
heroAlt: Logo image
|
||||
heroText: Hero Title
|
||||
tagline: Hero subtitle
|
||||
actionText: Get Started
|
||||
actionLink: /guide/
|
||||
features:
|
||||
- title: Simplicity First
|
||||
details: Minimal setup with markdown-centered project structure helps you focus on writing.
|
||||
- title: Vue-Powered
|
||||
details: Enjoy the dev experience of Vue + webpack, use Vue components in markdown, and develop custom themes with Vue.
|
||||
- title: Performant
|
||||
details: VitePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded.
|
||||
footer: MIT Licensed | Copyright © 2019-present Evan You
|
||||
---
|
||||
```
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
home: true
|
||||
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
|
||||
heroText: 开发手册
|
||||
tagline: 欢迎使用哪吒监控开发手册,我们欢迎你提出高质量的Pull Request,帮助哪吒监控变得更好!
|
||||
actionText: 开始使用 →
|
||||
actionLink: /developer/theme
|
||||
footer: Copyright © 2022-present Nezhahq
|
||||
---
|
||||
<br />本作品采用 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议</a> 进行许可。
|
||||
@@ -0,0 +1 @@
|
||||
敬请期待
|
||||
Reference in New Issue
Block a user