更新文档结构,增加开发手册区域,新增API、主题开发文档
This commit is contained in:
parent
6b0565c517
commit
da7d285f6b
@ -25,7 +25,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '开发手册',
|
text: '开发手册',
|
||||||
link: '/developer/basics',
|
link: '/developer/index',
|
||||||
activeMatch: '^/developer/'
|
activeMatch: '^/developer/'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -46,7 +46,7 @@ export default defineConfig({
|
|||||||
label: 'English',
|
label: 'English',
|
||||||
nav: [
|
nav: [
|
||||||
{ text: 'User Guide', link: '/en_US/', activeMatch: '^/$|^/en_US/guide/' },
|
{ text: 'User Guide', link: '/en_US/', activeMatch: '^/$|^/en_US/guide/' },
|
||||||
{ text: 'Development Manual', link: '/en_US/developer/basics', activeMatch: '^/en_US/developer/' }
|
{ text: 'Development Manual', link: '/en_US/developer/index', activeMatch: '^/en_US/developer/' }
|
||||||
],
|
],
|
||||||
|
|
||||||
sidebar: {
|
sidebar: {
|
||||||
@ -81,7 +81,8 @@ function getGuideSidebarZhCN() {
|
|||||||
{ text: '服务', link: '/guide/services' },
|
{ text: '服务', link: '/guide/services' },
|
||||||
{ text: '定时任务', link: '/guide/tasks' },
|
{ text: '定时任务', link: '/guide/tasks' },
|
||||||
{ text: '报警通知', link: '/guide/notifications' },
|
{ text: '报警通知', link: '/guide/notifications' },
|
||||||
{ text: '设置', link: '/guide/settings' }
|
{ text: '设置', link: '/guide/settings' },
|
||||||
|
{ text: 'API', link: '/guide/api' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -101,15 +102,9 @@ function getGuideSidebarZhCN() {
|
|||||||
function getDeveloperSidebarZhCN() {
|
function getDeveloperSidebarZhCN() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
text: 'App Config',
|
text: '开发手册',
|
||||||
children: [ { text: 'Basics', link: '/developer/basics' } ]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'Theme Config',
|
|
||||||
children: [
|
children: [
|
||||||
{ text: 'Homepage', link: '/developer/homepage' },
|
{ text: '创建新主题', link: '/developer/theme' }
|
||||||
{ text: 'Algolia Search', link: '/developer/algolia-search' },
|
|
||||||
{ text: 'Carbon Ads', link: '/developer/carbon-ads' }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -131,7 +126,8 @@ function getGuideSidebarEnUS() {
|
|||||||
{ text: 'Services', link: '/en_US/guide/services' },
|
{ text: 'Services', link: '/en_US/guide/services' },
|
||||||
{ text: 'Tasks', link: '/en_US/guide/tasks' },
|
{ text: 'Tasks', link: '/en_US/guide/tasks' },
|
||||||
{ text: 'Notifications', link: '/en_US/guide/notifications' },
|
{ text: 'Notifications', link: '/en_US/guide/notifications' },
|
||||||
{ text: 'Settings', link: '/en_US/guide/settings' }
|
{ text: 'Settings', link: '/en_US/guide/settings' },
|
||||||
|
{ text: 'API', link: '/en_US/guide/api' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -149,15 +145,9 @@ function getGuideSidebarEnUS() {
|
|||||||
function getDeveloperSidebarEnUS() {
|
function getDeveloperSidebarEnUS() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
text: 'App Config',
|
text: 'Development Manual',
|
||||||
children: [ { text: 'Basics', link: '/en_US/developer/basics' } ]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'Theme Config',
|
|
||||||
children: [
|
children: [
|
||||||
{ text: 'Homepage', link: '/en_US/developer/homepage' },
|
{ text: 'Create a new theme', link: '/en_US/developer/theme' }
|
||||||
{ text: 'Algolia Search', link: '/en_US/developer/algolia-search' },
|
|
||||||
{ text: 'Carbon Ads', link: '/en_US/developer/carbon-ads' }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -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
|
|
||||||
---
|
|
||||||
```
|
|
10
docs/developer/index.md
Normal file
10
docs/developer/index.md
Normal file
@ -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> 进行许可。
|
1
docs/developer/theme.md
Normal file
1
docs/developer/theme.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
敬请期待
|
@ -1 +0,0 @@
|
|||||||
# Theme Config: Algolia Search
|
|
@ -1 +0,0 @@
|
|||||||
# App Config: Basics
|
|
@ -1 +0,0 @@
|
|||||||
# Theme Config: Carbon Ads
|
|
@ -1 +0,0 @@
|
|||||||
# Theme Config: Homepage
|
|
10
docs/en_US/developer/index.md
Normal file
10
docs/en_US/developer/index.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
home: true
|
||||||
|
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
|
||||||
|
heroText: Development Manual
|
||||||
|
tagline: Welcome to the Nezha Monitoring Development Manual.
|
||||||
|
actionText: Start Now →
|
||||||
|
actionLink: /en_US/developer/theme
|
||||||
|
footer: Copyright © 2022-present Nezhahq
|
||||||
|
---
|
||||||
|
<br/>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
|
1
docs/en_US/developer/theme.md
Normal file
1
docs/en_US/developer/theme.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Comming soon
|
1
docs/en_US/guide/api.md
Normal file
1
docs/en_US/guide/api.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
Comming soon
|
@ -3,7 +3,7 @@ home: true
|
|||||||
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
|
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
|
||||||
heroText: Nezha Monitoring
|
heroText: Nezha Monitoring
|
||||||
tagline: A open source, lightweight server and website monitoring and O&M tool
|
tagline: A open source, lightweight server and website monitoring and O&M tool
|
||||||
actionText: Learn more →
|
actionText: Learn More →
|
||||||
actionLink: /en_US/guide/dashboard
|
actionLink: /en_US/guide/dashboard
|
||||||
features:
|
features:
|
||||||
- title: One-Click Installation
|
- title: One-Click Installation
|
||||||
|
1
docs/guide/api.md
Normal file
1
docs/guide/api.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
敬请期待
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -1841,12 +1841,6 @@
|
|||||||
"vue": "^3.2.33"
|
"vue": "^3.2.33"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vitepress-dark-theme": {
|
|
||||||
"version": "git+ssh://git@github.com/nezhahq/vitepress-dark-theme.git#52550f5807214d139b7219a72b66b0bd9031b078",
|
|
||||||
"dev": true,
|
|
||||||
"from": "vitepress-dark-theme@github:nezhahq/vitepress-dark-theme",
|
|
||||||
"requires": {}
|
|
||||||
},
|
|
||||||
"vue": {
|
"vue": {
|
||||||
"version": "3.2.33",
|
"version": "3.2.33",
|
||||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.2.33.tgz",
|
"resolved": "https://registry.npmjs.org/vue/-/vue-3.2.33.tgz",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user