Use Vuepress to generate a static site for docs.

This commit is contained in:
Rafi
2023-04-11 22:08:16 +08:00
parent e9f554dc4e
commit 1d7098a0cb
24 changed files with 1495 additions and 206 deletions

56
docs/.vuepress/config.ts Normal file
View File

@@ -0,0 +1,56 @@
import { defineUserConfig, defaultTheme } from 'vuepress'
import {
navbarEn,
navbarZh,
sidebarEn,
sidebarZh,
} from './configs/index.js'
export default defineUserConfig({
title: 'ChatGPT UI',
description: 'A ChatGPT web client',
base: '/chatgpt-ui/',
locales: {
// 键名是该语言所属的子路径
// 作为特例,默认语言可以使用 '/' 作为其路径。
'/': {
lang: 'en-US',
description: 'A ChatGPT web client',
},
'/zh/': {
lang: 'zh-CN',
description: '一个 ChatGPT 的 Web 客户端',
},
},
theme: defaultTheme({
locales: {
'/': {
// navbar
navbar: navbarEn,
// sidebar
sidebar: sidebarEn,
},
'/zh/': {
// navbar
navbar: navbarZh,
selectLanguageName: '简体中文',
selectLanguageText: '选择语言',
selectLanguageAriaLabel: '选择语言',
// sidebar
sidebar: sidebarZh,
// 404 page
notFound: [
'这里什么都没有',
'我们怎么到这来了?',
'这是一个 404 页面',
'看起来我们进入了错误的链接',
],
backToHome: '返回首页',
// a11y
openInNewWindow: '在新窗口打开',
toggleColorMode: '切换颜色模式',
toggleSidebar: '切换侧边栏',
},
},
}),
})

View File

@@ -0,0 +1,2 @@
export * from './navbar/index.js'
export * from './sidebar/index.js'

View File

@@ -0,0 +1,12 @@
import type { NavbarConfig } from '@vuepress/theme-default'
export const navbarEn: NavbarConfig = [
{
text: 'Guide',
link: '/',
},
{
text: 'Changelog',
link: 'https://github.com/WongSaang/chatgpt-ui/releases'
}
]

View File

@@ -0,0 +1,2 @@
export * from './en.js'
export * from './zh.js'

View File

@@ -0,0 +1,12 @@
import type { NavbarConfig } from '@vuepress/theme-default'
export const navbarZh: NavbarConfig = [
{
text: '指南',
link: '/zh/',
},
{
text: '更新日志',
link: 'https://github.com/WongSaang/chatgpt-ui/releases',
}
]

View File

@@ -0,0 +1,17 @@
import type { SidebarConfig } from '@vuepress/theme-default'
export const sidebarEn: SidebarConfig = {
'/': [
{
text: 'Guide',
children: [
'/README.md',
'/guide/quick-start.md',
'/guide/configuration.md',
'/guide/problems.md',
'/guide/development.md',
'/guide/buymeacoffee.md',
],
},
]
}

View File

@@ -0,0 +1,2 @@
export * from './en.js'
export * from './zh.js'

View File

@@ -0,0 +1,17 @@
import type { SidebarConfig } from '@vuepress/theme-default'
export const sidebarZh: SidebarConfig = {
'/zh/': [
{
text: '指南',
children: [
'/zh/README.md',
'/zh/guide/quick-start.md',
'/zh/guide/configuration.md',
'/zh/guide/problems.md',
'/zh/guide/development.md',
'/zh/guide/buymeacoffee.md',
],
},
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB