Skip to content

Commit 1b23150

Browse files
committed
feat: built with theme-hope
1 parent 81e869f commit 1b23150

80 files changed

Lines changed: 1858 additions & 314 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy docs with theme-hope
2+
3+
on:
4+
push:
5+
branches:
6+
- theme-hope
7+
8+
jobs:
9+
deploy-netlify:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v6
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Install pnpm
18+
uses: pnpm/action-setup@v6
19+
with:
20+
run_install: true
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v6
24+
with:
25+
node-version: 24
26+
cache: pnpm
27+
28+
- name: Build docs
29+
run: |-
30+
pnpm run docs:build
31+
> docs/.vuepress/dist/.nojekyll
32+
33+
- name: Deploy docs
34+
uses: JamesIves/github-pages-deploy-action@v4
35+
with:
36+
branch: netlify
37+
folder: docs/.vuepress/dist

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@
4141
"vuepress",
4242
"vueuse",
4343
"zoomable"
44-
]
44+
],
45+
"markdown.extension.toc.updateOnSave": false
4546
}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66

77
VuePress documentation repository.
88

9+
This branch holds a VuePress2 official docs powered by [VuePress Theme Hope](https://theme-hope.vuejs.press).
10+
911
## Deployments
1012

11-
- Release deployment: <https://vuepress.vuejs.org>
13+
- Release deployment: <https://vuejs.press>
1214
- Developer deployment: <https://vuepress.github.io>
1315

1416
## License

docs/.vuepress/config.ts

Lines changed: 4 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,16 @@ import process from 'node:process'
33

44
import { viteBundler } from '@vuepress/bundler-vite'
55
import { webpackBundler } from '@vuepress/bundler-webpack'
6-
import { docsearchPlugin } from '@vuepress/plugin-docsearch'
76
import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics'
87
import { registerComponentsPlugin } from '@vuepress/plugin-register-components'
9-
import { shikiPlugin } from '@vuepress/plugin-shiki'
10-
import { defaultTheme } from '@vuepress/theme-default'
118
import { defineUserConfig } from 'vuepress'
129
import { getDirname, path } from 'vuepress/utils'
1310

14-
import {
15-
head,
16-
navbarEn,
17-
navbarZh,
18-
sidebarEn,
19-
sidebarZh,
20-
} from './configs/index.js'
11+
import { head } from './configs/index.js'
12+
import theme from './theme.js'
2113

2214
const __dirname = getDirname(import.meta.url)
2315
const require = createRequire(import.meta.url)
24-
const isProd = process.env.NODE_ENV === 'production'
2516

2617
export default defineUserConfig({
2718
// set site base to default value
@@ -48,73 +39,6 @@ export default defineUserConfig({
4839
bundler:
4940
process.env.DOCS_BUNDLER === 'webpack' ? webpackBundler() : viteBundler(),
5041

51-
// configure default theme
52-
theme: defaultTheme({
53-
hostname: 'https://vuepress.vuejs.org',
54-
logo: '/images/hero.png',
55-
repo: 'vuepress/core',
56-
docsRepo: 'vuepress/docs',
57-
docsDir: 'docs',
58-
59-
// theme-level locales config
60-
locales: {
61-
/**
62-
* English locale config
63-
*
64-
* As the default locale of @vuepress/theme-default is English,
65-
* we don't need to set all of the locale fields
66-
*/
67-
'/': {
68-
// navbar
69-
navbar: navbarEn,
70-
// sidebar
71-
sidebar: sidebarEn,
72-
// page meta
73-
editLinkText: 'Edit this page on GitHub',
74-
},
75-
76-
/**
77-
* Chinese locale config
78-
*/
79-
'/zh/': {
80-
// navbar
81-
navbar: navbarZh,
82-
selectLanguageName: '简体中文',
83-
selectLanguageText: '选择语言',
84-
selectLanguageAriaLabel: '选择语言',
85-
// sidebar
86-
sidebar: sidebarZh,
87-
// page meta
88-
editLinkText: '在 GitHub 上编辑此页',
89-
lastUpdatedText: '上次更新',
90-
contributorsText: '贡献者',
91-
// custom containers
92-
tip: '提示',
93-
warning: '注意',
94-
danger: '警告',
95-
// 404 page
96-
notFound: [
97-
'这里什么都没有',
98-
'我们怎么到这来了?',
99-
'这是一个 404 页面',
100-
'看起来我们进入了错误的链接',
101-
],
102-
backToHome: '返回首页',
103-
// a11y
104-
openInNewWindow: '在新窗口打开',
105-
toggleColorMode: '切换颜色模式',
106-
toggleSidebar: '切换侧边栏',
107-
},
108-
},
109-
110-
themePlugins: {
111-
// only enable git plugin in production mode
112-
git: isProd,
113-
// use shiki plugin in production mode instead
114-
prismjs: !isProd,
115-
},
116-
}),
117-
11842
// configure markdown
11943
markdown: {
12044
importCode: {
@@ -135,72 +59,16 @@ export default defineUserConfig({
13559
},
13660
},
13761

62+
theme,
63+
13864
// use plugins
13965
plugins: [
140-
docsearchPlugin({
141-
appId: '34YFD9IUQ2',
142-
apiKey: '9a9058b8655746634e01071411c366b8',
143-
indexName: 'vuepress',
144-
searchParameters: {
145-
facetFilters: ['tags:v2'],
146-
},
147-
locales: {
148-
'/zh/': {
149-
placeholder: '搜索文档',
150-
translations: {
151-
button: {
152-
buttonText: '搜索文档',
153-
buttonAriaLabel: '搜索文档',
154-
},
155-
modal: {
156-
searchBox: {
157-
clearButtonTitle: '清除查询条件',
158-
clearButtonAriaLabel: '清除查询条件',
159-
closeButtonText: '取消',
160-
closeButtonAriaLabel: '取消',
161-
},
162-
startScreen: {
163-
recentSearchesTitle: '搜索历史',
164-
noRecentSearchesText: '没有搜索历史',
165-
saveRecentSearchButtonTitle: '保存至搜索历史',
166-
removeRecentSearchButtonTitle: '从搜索历史中移除',
167-
favoriteSearchesTitle: '收藏',
168-
removeFavoriteSearchButtonTitle: '从收藏中移除',
169-
},
170-
errorScreen: {
171-
titleText: '无法获取结果',
172-
helpText: '你可能需要检查你的网络连接',
173-
},
174-
footer: {
175-
selectText: '选择',
176-
navigateText: '切换',
177-
closeText: '关闭',
178-
poweredByText: '搜索提供者',
179-
},
180-
noResultsScreen: {
181-
noResultsText: '无法找到相关结果',
182-
suggestedQueryText: '你可以尝试查询',
183-
reportMissingResultsText: '你认为该查询应该有结果?',
184-
reportMissingResultsLinkText: '点击反馈',
185-
},
186-
},
187-
},
188-
},
189-
},
190-
}),
19166
googleAnalyticsPlugin({
19267
// we have multiple deployments, which would use different id
19368
id: process.env.DOCS_GA_ID ?? '',
19469
}),
19570
registerComponentsPlugin({
19671
componentsDir: path.resolve(__dirname, './components'),
19772
}),
198-
// only enable shiki plugin in production mode
199-
isProd
200-
? shikiPlugin({
201-
langs: ['bash', 'diff', 'json', 'md', 'ts', 'vue'],
202-
theme: 'dark-plus',
203-
})
204-
: [],
20573
],
20674
})
Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import type { NavbarOptions } from '@vuepress/theme-default'
1+
import { navbar } from 'vuepress-theme-hope'
22

33
import { VERSION } from '../meta.js'
44

5-
export const navbarEn: NavbarOptions = [
5+
export const NAVBAR_EN = navbar([
66
{
77
text: 'Guide',
8+
icon: 'fa6-solid:lightbulb',
89
children: [
910
'/guide/introduction.md',
1011
'/guide/getting-started.md',
@@ -23,39 +24,42 @@ export const navbarEn: NavbarOptions = [
2324
},
2425
{
2526
text: 'Reference',
27+
icon: 'fa6-solid:book',
28+
prefix: '/reference/',
2629
children: [
2730
{
2831
text: 'Core',
2932
children: [
3033
{
3134
text: 'CLI',
32-
link: '/reference/cli.html',
35+
icon: 'bi:terminal-fill',
36+
link: 'cli.html',
3337
},
34-
'/reference/config.md',
35-
'/reference/frontmatter.md',
36-
'/reference/components.md',
37-
'/reference/plugin-api.md',
38-
'/reference/theme-api.md',
39-
'/reference/client-api.md',
40-
'/reference/node-api.md',
38+
'config',
39+
'frontmatter',
40+
'components',
41+
'plugin-api',
42+
'theme-api',
43+
'client-api',
44+
'node-api',
4145
],
4246
},
4347
{
4448
text: 'Bundlers',
45-
children: [
46-
'/reference/bundler/vite.md',
47-
'/reference/bundler/webpack.md',
48-
],
49+
prefix: 'bundler/',
50+
children: ['vite', 'webpack'],
4951
},
5052
{
5153
text: 'Ecosystem',
5254
children: [
5355
{
5456
text: 'Default Theme',
57+
icon: 'fa6-solid:palette',
5558
link: 'https://ecosystem.vuejs.press/themes/default/',
5659
},
5760
{
5861
text: 'Plugins',
62+
icon: 'fa6-solid:puzzle-piece',
5963
link: 'https://ecosystem.vuejs.press/plugins/',
6064
},
6165
],
@@ -65,16 +69,19 @@ export const navbarEn: NavbarOptions = [
6569

6670
{
6771
text: 'Learn More',
72+
icon: 'fa6-solid:feather',
6873
children: [
6974
{
7075
text: 'Advanced',
76+
prefix: '/advanced/',
7177
children: [
72-
'/advanced/architecture.md',
73-
'/advanced/plugin.md',
74-
'/advanced/theme.md',
78+
'architecture',
79+
'plugin',
80+
'theme',
7581
{
7682
text: 'Cookbook',
77-
link: '/advanced/cookbook/',
83+
icon: 'fa6-solid:signs-post',
84+
link: 'cookbook/',
7885
},
7986
],
8087
},
@@ -83,14 +90,17 @@ export const navbarEn: NavbarOptions = [
8390
children: [
8491
{
8592
text: 'Ecosystem',
93+
icon: 'fa6-solid:leaf',
8694
link: 'https://ecosystem.vuejs.press/',
8795
},
8896
{
8997
text: 'MarketPlace',
98+
icon: 'fa6-solid:cart-shopping',
9099
link: 'https://marketplace.vuejs.press',
91100
},
92101
{
93102
text: 'Contributing Guide',
103+
icon: 'fa6-solid:signs-post',
94104
link: 'https://github.com/vuepress/core/blob/main/CONTRIBUTING.md',
95105
},
96106
],
@@ -102,17 +112,19 @@ export const navbarEn: NavbarOptions = [
102112
children: [
103113
{
104114
text: 'Changelog',
105-
link: 'https://github.com/vuepress/core/blob/main/CHANGELOG.md',
115+
icon: 'fa6-solid:clock',
116+
link: 'https://github.com/vuepress/vuepress-next/blob/main/CHANGELOG.md',
106117
},
107118
{
108119
text: 'v1.x',
120+
icon: 'fa6-brands:vuejs',
109121
link: 'https://v1.vuepress.vuejs.org',
110122
},
111123
{
112124
text: 'v0.x',
125+
icon: 'fa6-brands:vuejs',
113126
link: 'https://v0.vuepress.vuejs.org',
114127
},
115128
],
116129
},
117-
// TODO: remove the type assertion
118-
] as NavbarOptions
130+
])

0 commit comments

Comments
 (0)