添加多语言、修改文章结构、新增安装指南

This commit is contained in:
hhhkkk520
2022-05-17 14:26:01 +02:00
parent 705f805b26
commit bc5ba38697
23 changed files with 734 additions and 1762 deletions
+162 -55
View File
@@ -1,82 +1,134 @@
import { defineConfig } from 'vitepress'
export default defineConfig({
lang: 'en-US',
title: 'VitePress',
description: 'Vite & Vue powered static site generator.',
lastUpdated: true,
locales: {
'/': {
lang: 'zh-CN',
title: '哪吒监控',
description: '哪吒监控是一个轻量化的运维工具',
},
'/en_US/': {
lang: 'en-US',
title: 'Nezha Monitoring',
description: 'Nezha Monitoring is a lightweight O&M tool',
}
},
themeConfig: {
repo: 'vuejs/vitepress',
docsDir: 'docs',
docsBranch: 'main',
editLinks: true,
editLinkText: 'Edit this page on GitHub',
lastUpdated: 'Last Updated',
locales: {
'/': {
label: '简体中文',
nav: [
{ text: '使用指南', link: '/', activeMatch: '^/$|^/guide/' },
{
text: '开发手册',
link: '/config/basics',
activeMatch: '^/config/'
}
],
sidebar: {
'/guide/': getGuideSidebarZhCN(),
'/config/': getConfigSidebarZhCN(),
'/': 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'
},
algolia: {
appId: '8J64VVRP8K',
apiKey: 'a18e2f4cc5665f6602c5631fd868adfd',
indexName: 'vitepress'
},
carbonAds: {
carbon: 'CEBDT27Y',
custom: 'CKYD62QM',
placement: 'vuejsorg'
},
nav: [
{ text: 'Guide', link: '/', activeMatch: '^/$|^/guide/' },
{
text: 'Config Reference',
link: '/config/basics',
activeMatch: '^/config/'
carbonAds: {
carbon: 'CEBDT27Y',
custom: 'CKYD62QM',
placement: 'vuejsorg'
}
},
{
text: 'Release Notes',
link: 'https://github.com/vuejs/vitepress/releases'
}
],
'/en_US/': {
label: 'English',
nav: [
{ text: 'User Guide', link: '/en_US/', activeMatch: '^/$|^/guide/' },
{
text: 'Development Manual',
link: '/en_US/config/basics',
activeMatch: '^/config/'
}
],
sidebar: {
'/guide/': getGuideSidebarEnUS(),
'/config/': getConfigSidebarEnUS(),
'/': getGuideSidebarEnUS()
},
repo: 'nezhahq/nezhahq.github.io',
docsDir: 'docs',
docsBranch: 'main',
editLinks: true,
editLinkText: 'Edit this page on GitHub',
lastUpdated: 'Last Updated',
sidebar: {
'/guide/': getGuideSidebar(),
'/config/': getConfigSidebar(),
'/': getGuideSidebar()
algolia: {
appId: '8J64VVRP8K',
apiKey: 'a18e2f4cc5665f6602c5631fd868adfd',
indexName: 'vitepress'
},
carbonAds: {
carbon: 'CEBDT27Y',
custom: 'CKYD62QM',
placement: 'vuejsorg'
}
}
}
}
})
function getGuideSidebar() {
function getGuideSidebarZhCN() {
return [
{
text: 'Introduction',
text: '哪吒监控',
children: [
{ text: 'What is VitePress?', link: '/' },
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Configuration', link: '/guide/configuration' },
{ text: 'Asset Handling', link: '/guide/assets' },
{ text: 'Markdown Extensions', link: '/guide/markdown' },
{ text: 'Using Vue in Markdown', link: '/guide/using-vue' },
{ text: 'Deploying', link: '/guide/deploy' }
{ text: '介绍', link: '/' }
]
},
{
text: 'Advanced',
text: '安装手册',
children: [
{ text: 'Frontmatter', link: '/guide/frontmatter' },
{ text: 'Theming', link: '/guide/theming' },
{ text: 'API Reference', link: '/guide/api' },
{
text: 'Differences from Vuepress',
link: '/guide/differences-from-vuepress'
}
{ text: '安装 Dashboard', link: '/guide/dashboard' },
{ text: '安装 Agent', link: '/guide/agent' }
]
},
{
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: '常见问题',
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' }
]
}
]
}
function getConfigSidebar() {
function getConfigSidebarZhCN() {
return [
{
text: 'App Config',
@@ -92,3 +144,58 @@ function getConfigSidebar() {
}
]
}
function getGuideSidebarEnUS() {
return [
{
text: 'Nezha Monitoring',
children: [
{ text: 'Introduction', link: '/en_US/' }
]
},
{
text: 'Installation',
children: [
{ text: 'Install Dashboard', link: '/en_US/guide/dashboard' },
{ text: 'Install Agent', link: '/en_US/guide/agent' }
]
},
{
text: 'Advanced Configuration',
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: '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' }
]
}
]
}
function getConfigSidebarEnUS() {
return [
{
text: 'App Config',
children: [{ text: 'Basics', link: '/en_US/config/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' }
]
}
]
}