-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(docs): refine vitepress config
- Loading branch information
Showing
5 changed files
with
150 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,52 @@ | ||
import { defineConfig } from 'vitepress'; | ||
import { shared } from './shared'; | ||
|
||
import { en } from './en'; | ||
import { zh } from './zh'; | ||
|
||
// https://vitepress.dev/reference/site-config | ||
/** | ||
* @see https://vitepress.dev/reference/site-config | ||
*/ | ||
export default defineConfig({ | ||
...shared, | ||
title: 'Live777', | ||
|
||
lastUpdated: true, | ||
cleanUrls: true, | ||
metaChunk: true, | ||
|
||
head: [ | ||
['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }], | ||
['meta', { name: 'theme-color', content: '#5f67ee' }], | ||
['meta', { property: 'og:type', content: 'website' }], | ||
['meta', { property: 'og:locale', content: 'en' }], | ||
['meta', { property: 'og:title', content: 'Live777 | A very simple, high performance, edge WebRTC SFU' }], | ||
['meta', { property: 'og:site_name', content: 'VitePress' }], | ||
['meta', { property: 'og:image', content: 'https://live777.binbat.com/logo.svg' }], | ||
['meta', { property: 'og:url', content: 'https://live777.binbat.com/' }], | ||
], | ||
|
||
themeConfig: { | ||
logo: { src: '/logo.svg', width: 24, height: 24 }, | ||
|
||
socialLinks: [ | ||
{ icon: 'github', link: 'https://github.com/binbat/live777' } | ||
], | ||
|
||
footer: { | ||
message: 'Released under the MPL-2.0 License.', | ||
copyright: 'Copyright © 2023-present BinBat LTD' | ||
} | ||
}, | ||
|
||
locales: { | ||
root: { label: 'English', ...en }, | ||
zh: { label: '简体中文', ...zh }, | ||
root: en, | ||
zh, | ||
}, | ||
|
||
vite: { | ||
css: { | ||
postcss: { | ||
// don't need postcss in docs | ||
} | ||
} | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineConfig } from 'vitepress'; | ||
|
||
type LocalesType = NonNullable<Parameters<typeof defineConfig>[0]['locales']>; | ||
type LocalesValueType = LocalesType[keyof LocalesType]; | ||
|
||
export type LocaleConfig = LocalesValueType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,62 @@ | ||
import { type LocaleConfig } from './types'; | ||
|
||
import { defineConfig } from 'vitepress'; | ||
|
||
export const zh = defineConfig({ | ||
export const zh: LocaleConfig = { | ||
lang: 'zh-Hans', | ||
label: '简体中文', | ||
description: '简单,高性能,WebRTC SFU', | ||
|
||
themeConfig: { | ||
nav: [ | ||
{ text: 'Home', link: '/' }, | ||
{ text: '指引', link: '/guide/what-is-live777' } | ||
{ text: '主页', link: '/zh/' }, | ||
{ text: '指引', link: '/zh/guide/what-is-live777' } | ||
], | ||
|
||
|
||
sidebar: { | ||
'/zh/guide/': { base: '/zh/guide/', items: [ | ||
{ | ||
text: '简介', | ||
collapsed: false, | ||
items: [ | ||
{ text: '什么是 Live777 ?', link: 'what-is-live777' }, | ||
{ text: '安装部署', link: 'installation' }, | ||
{ text: '快速开始', link: 'getting-started' }, | ||
{ text: '开发者', link: 'developer' }, | ||
] | ||
}, | ||
{ | ||
text: '组件', | ||
collapsed: false, | ||
items: [ | ||
{ text: 'Live777', link: 'live777' }, | ||
{ text: 'Web UI', link: 'webui' }, | ||
{ text: 'LiveMan', link: 'liveman' }, | ||
{ text: 'WhipInto', link: 'whipinto' }, | ||
{ text: 'WhepFrom', link: 'whepfrom' }, | ||
{ text: 'NET4MQTT', link: 'net4mqtt' }, | ||
] | ||
}, | ||
{ | ||
text: '例子', | ||
collapsed: false, | ||
items: [ | ||
{ text: 'OBS Studio', link: 'obs-studio' }, | ||
{ text: 'FFmpeg', link: 'ffmpeg' }, | ||
{ text: 'Gstreamer', link: 'gstreamer' }, | ||
{ text: 'VLC', link: 'vlc' }, | ||
] | ||
}, | ||
{ | ||
text: '参考', | ||
collapsed: false, | ||
items: [ | ||
{ text: 'Live777 API', link: 'live777-api' }, | ||
{ text: 'LiveMan API', link: 'liveman-api' }, | ||
] | ||
} | ||
]}, | ||
'/zh/guide/': { | ||
base: '/zh/guide/', | ||
items: [ | ||
{ | ||
text: '简介', | ||
collapsed: false, | ||
items: [ | ||
{ text: '什么是 Live777 ?', link: 'what-is-live777' }, | ||
{ text: '安装部署', link: 'installation' }, | ||
{ text: '快速开始', link: 'getting-started' }, | ||
{ text: '开发者', link: 'developer' }, | ||
] | ||
}, | ||
{ | ||
text: '组件', | ||
collapsed: false, | ||
items: [ | ||
{ text: 'Live777', link: 'live777' }, | ||
{ text: 'Web UI', link: 'webui' }, | ||
{ text: 'LiveMan', link: 'liveman' }, | ||
{ text: 'WhipInto', link: 'whipinto' }, | ||
{ text: 'WhepFrom', link: 'whepfrom' }, | ||
{ text: 'NET4MQTT', link: 'net4mqtt' }, | ||
] | ||
}, | ||
{ | ||
text: '例子', | ||
collapsed: false, | ||
items: [ | ||
{ text: 'OBS Studio', link: 'obs-studio' }, | ||
{ text: 'FFmpeg', link: 'ffmpeg' }, | ||
{ text: 'Gstreamer', link: 'gstreamer' }, | ||
{ text: 'VLC', link: 'vlc' }, | ||
] | ||
}, | ||
{ | ||
text: '参考', | ||
collapsed: false, | ||
items: [ | ||
{ text: 'Live777 API', link: 'live777-api' }, | ||
{ text: 'LiveMan API', link: 'liveman-api' }, | ||
] | ||
} | ||
] | ||
}, | ||
}, | ||
} | ||
}); | ||
}; |