Merge pull request #2 from hhhkkk520/main

添加首页、移除死链、移除搜索和广告、修复上一篇/下一篇链接跳转不正常的问题

Co-authored-by: hhhkkk520 <52115472+hhhkkk520@users.noreply.github.com>
This commit is contained in:
naiba 2022-05-17 23:58:13 +08:00 committed by GitHub
commit 3326975422
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 107 additions and 228 deletions

View File

@ -19,72 +19,47 @@ export default defineConfig({
'/': {
label: '简体中文',
nav: [
{ text: '使用指南', link: '/', activeMatch: '^/$|^/guide/' },
{ text: '使用指南',
link: '/',
activeMatch: '^/$|^/guide/'
},
{
text: '开发手册',
link: '/config/basics',
activeMatch: '^/config/'
link: '/developer/basics',
activeMatch: '^/developer/'
}
],
sidebar: {
'/guide/': getGuideSidebarZhCN(),
'/config/': getConfigSidebarZhCN(),
'/developer/': getDeveloperSidebarZhCN(),
'/': getGuideSidebarZhCN()
},
repo: 'nezhahq/nezhahq.github.io',
docsDir: 'docs',
docsBranch: 'main',
editLinks: true,
editLinkText: 'Edit this page on GitHub',
lastUpdated: 'Last Updated',
algolia: {
appId: '8J64VVRP8K',
apiKey: 'a18e2f4cc5665f6602c5631fd868adfd',
indexName: 'vitepress'
},
carbonAds: {
carbon: 'CEBDT27Y',
custom: 'CKYD62QM',
placement: 'vuejsorg'
}
editLinkText: '在GitHub中编辑',
lastUpdated: '上次更新'
},
'/en_US/': {
label: 'English',
nav: [
{ text: 'User Guide', link: '/en_US/', activeMatch: '^/$|^/guide/' },
{
text: 'Development Manual',
link: '/en_US/config/basics',
activeMatch: '^/config/'
}
{ text: 'User Guide', link: '/en_US/', activeMatch: '^/$|^/en_US/guide/' },
{ text: 'Development Manual', link: '/en_US/developer/basics', activeMatch: '^/en_US/developer/' }
],
sidebar: {
'/guide/': getGuideSidebarEnUS(),
'/config/': getConfigSidebarEnUS(),
'/': getGuideSidebarEnUS()
'/en_US/guide/': getGuideSidebarEnUS(),
'/en_US/developer/': getDeveloperSidebarEnUS(),
'/en_US/': getGuideSidebarEnUS()
},
repo: 'nezhahq/nezhahq.github.io',
docsDir: 'docs',
docsBranch: 'main',
editLinks: true,
editLinkText: 'Edit this page on GitHub',
lastUpdated: 'Last Updated',
algolia: {
appId: '8J64VVRP8K',
apiKey: 'a18e2f4cc5665f6602c5631fd868adfd',
indexName: 'vitepress'
},
carbonAds: {
carbon: 'CEBDT27Y',
custom: 'CKYD62QM',
placement: 'vuejsorg'
}
lastUpdated: 'Last Updated'
}
}
}
@ -108,38 +83,38 @@ function getGuideSidebarZhCN() {
{
text: '管理面板配置',
children: [
{ text: '主机', link: '/guide/frontmatter' },
{ text: '服务', link: '/guide/theming' },
{ text: '定时任务', link: '/guide/api' },
{ text: '报警通知', link: '/guide/api' },
{ text: '设置', link: '/guide/differences-from-vuepress' }
{ text: '主机', link: '/guide/servers' },
{ text: '服务', link: '/guide/services' },
{ text: '定时任务', link: '/guide/tasks' },
{ text: '报警通知', link: '/guide/notifications' },
{ text: '设置', link: '/guide/settings' }
]
},
{
text: '常见问题',
children: [
{ text: '问题1', link: '/guide/frontmatter' },
{ text: '问题2', link: '/guide/theming' },
{ text: '问题3', link: '/guide/api' },
{ text: '问题4', link: '/guide/api' },
{ text: '问题5', link: '/guide/differences-from-vuepress' }
{ text: '问题1', link: '/guide/q1' },
{ text: '问题2', link: '/guide/q2' },
{ text: '问题3', link: '/guide/q3' },
{ text: '问题4', link: '/guide/q4' },
{ text: '问题5', link: '/guide/q5' }
]
}
]
}
function getConfigSidebarZhCN() {
function getDeveloperSidebarZhCN() {
return [
{
text: 'App Config',
children: [{ text: 'Basics', link: '/config/basics' }]
children: [ { text: 'Basics', link: '/developer/basics' } ]
},
{
text: 'Theme Config',
children: [
{ text: 'Homepage', link: '/config/homepage' },
{ text: 'Algolia Search', link: '/config/algolia-search' },
{ text: 'Carbon Ads', link: '/config/carbon-ads' }
{ text: 'Homepage', link: '/developer/homepage' },
{ text: 'Algolia Search', link: '/developer/algolia-search' },
{ text: 'Carbon Ads', link: '/developer/carbon-ads' }
]
}
]
@ -154,47 +129,47 @@ function getGuideSidebarEnUS() {
]
},
{
text: 'Installation',
text: 'Installation Manual',
children: [
{ text: 'Install Dashboard', link: '/en_US/guide/dashboard' },
{ text: 'Install Agent', link: '/en_US/guide/agent' }
]
},
{
text: 'Advanced Configuration',
text: 'Admin Panel',
children: [
{ text: 'Servers', link: '/guide/frontmatter' },
{ text: 'Services', link: '/guide/theming' },
{ text: 'Tasks', link: '/guide/api' },
{ text: 'Notifications', link: '/guide/api' },
{ text: 'Settings', link: '/guide/differences-from-vuepress' }
{ text: 'Servers', link: '/en_US/guide/servers' },
{ text: 'Services', link: '/en_US/guide/services' },
{ text: 'Tasks', link: '/en_US/guide/tasks' },
{ text: 'Notifications', link: '/en_US/guide/notifications' },
{ text: 'Settings', link: '/en_US/guide/settings' }
]
},
{
text: 'FAQ',
children: [
{ text: '问题1', link: '/guide/frontmatter' },
{ text: '问题2', link: '/guide/theming' },
{ text: '问题3', link: '/guide/api' },
{ text: '问题4', link: '/guide/api' },
{ text: '问题5', link: '/guide/differences-from-vuepress' }
{ text: 'Q1', link: '/en_US/guide/q1' },
{ text: 'Q2', link: '/en_US/guide/q2' },
{ text: 'Q3', link: '/en_US/guide/q3' },
{ text: 'Q4', link: '/en_US/guide/q4' },
{ text: 'Q5', link: '/en_US/guide/q5' }
]
}
]
}
function getConfigSidebarEnUS() {
function getDeveloperSidebarEnUS() {
return [
{
text: 'App Config',
children: [{ text: 'Basics', link: '/en_US/config/basics' }]
children: [ { text: 'Basics', link: '/en_US/developer/basics' } ]
},
{
text: 'Theme Config',
children: [
{ text: 'Homepage', link: '/en_US/config/homepage' },
{ text: 'Algolia Search', link: '/en_US/config/algolia-search' },
{ text: 'Carbon Ads', link: '/en_US/config/carbon-ads' }
{ text: 'Homepage', link: '/en_US/developer/homepage' },
{ text: 'Algolia Search', link: '/en_US/developer/algolia-search' },
{ text: 'Carbon Ads', link: '/en_US/developer/carbon-ads' }
]
}
]

View File

@ -1,6 +1,6 @@
# 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](../guide/frontmatter). This is an example of how it works:
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
---

View File

@ -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.

View File

@ -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'
}
```

View File

@ -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'
}
}
}
```

View File

@ -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](../guide/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
---
```

View File

@ -0,0 +1 @@
# Theme Config: Algolia Search

View File

@ -0,0 +1 @@
# App Config: Basics

View File

@ -0,0 +1 @@
# Theme Config: Carbon Ads

View File

@ -0,0 +1 @@
# Theme Config: Homepage

View File

@ -84,7 +84,7 @@ location ~ ^/(ws|terminal/.+)$ {
* CaddyServer v1v2 无需特别配置)
```Caddyfile
```
proxy /ws http://ip:8008 {
websocket
}

View File

@ -0,0 +1 @@
notifications

1
docs/en_US/guide/q1.md Normal file
View File

@ -0,0 +1 @@
q1

1
docs/en_US/guide/q2.md Normal file
View File

@ -0,0 +1 @@
q2

1
docs/en_US/guide/q3.md Normal file
View File

@ -0,0 +1 @@
q3

1
docs/en_US/guide/q4.md Normal file
View File

@ -0,0 +1 @@
q4

1
docs/en_US/guide/q5.md Normal file
View File

@ -0,0 +1 @@
q5

View File

@ -0,0 +1 @@
servers

View File

@ -0,0 +1 @@
services

View File

@ -0,0 +1 @@
settings

View File

@ -0,0 +1 @@
tasks

View File

@ -1 +1,16 @@
## What is Nezha Monitoring?
---
home: true
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
heroText: Nezha Monitoring
tagline: Self-hosted lightweight multi-server and website monitoring and alerting.
actionText: Learn more →
actionLink: /en_US/guide/dashboard
features:
- title: 特性1
details: 特性1特性1特性1
- title: 特性2
details: 特性2特性2特性2
- title: 特性3
details: 特性3特性3特性3
footer: Licence | Copyright © 2022-present Nezhahq
---

View File

@ -84,7 +84,7 @@ location ~ ^/(ws|terminal/.+)$ {
* CaddyServer v1v2 无需特别配置)
```Caddyfile
```
proxy /ws http://ip:8008 {
websocket
}

View File

@ -0,0 +1 @@
# 通知

1
docs/guide/q1.md Normal file
View File

@ -0,0 +1 @@
# 问题1

1
docs/guide/q2.md Normal file
View File

@ -0,0 +1 @@
# 问题2

1
docs/guide/q3.md Normal file
View File

@ -0,0 +1 @@
# 问题3

1
docs/guide/q4.md Normal file
View File

@ -0,0 +1 @@
# 问题4

1
docs/guide/q5.md Normal file
View File

@ -0,0 +1 @@
# 问题5

1
docs/guide/servers.md Normal file
View File

@ -0,0 +1 @@
# 服务器

1
docs/guide/services.md Normal file
View File

@ -0,0 +1 @@
# 服务

1
docs/guide/settings.md Normal file
View File

@ -0,0 +1 @@
# 设置

1
docs/guide/tasks.md Normal file
View File

@ -0,0 +1 @@
# 任务

View File

@ -1 +1,16 @@
## 哪吒监控是什么?
---
home: true
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
heroText: 哪吒监控
tagline: 轻量的自托管监控、运维工具
actionText: 开始使用 →
actionLink: /guide/dashboard
features:
- title: 特性1
details: 特性1特性1特性1
- title: 特性2
details: 特性2特性2特性2
- title: 特性3
details: 特性3特性3特性3
footer: Licence | Copyright © 2022-present Nezhahq
---