Skip to content

Commit 77e9e4f

Browse files
authored
docs: use voidzero theme (#165)
1 parent 97ad195 commit 77e9e4f

File tree

13 files changed

+782
-278
lines changed

13 files changed

+782
-278
lines changed

docs/.vitepress/config.ts

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
2+
import { extendConfig } from '@voidzero-dev/vitepress-theme/config'
23
import { defineConfig } from 'vitepress'
34
import {
45
groupIconMdPlugin,
@@ -7,26 +8,38 @@ import {
78
import { withMermaid } from 'vitepress-plugin-mermaid'
89
import { version } from '../../package.json'
910

11+
const DevToolsKitNav = [
12+
{ text: 'Introduction', link: '/kit/' },
13+
{ text: 'DevTools Plugin', link: '/kit/devtools-plugin' },
14+
{ text: 'Dock System', link: '/kit/dock-system' },
15+
{ text: 'RPC', link: '/kit/rpc' },
16+
{ text: 'Shared State', link: '/kit/shared-state' },
17+
]
18+
19+
const SocialLinks = [
20+
{ icon: 'bluesky', link: 'https://bsky.app/profile/vite.dev' },
21+
{ icon: 'mastodon', link: 'https://elk.zone/m.webtoo.ls/@vite' },
22+
{ icon: 'x', link: 'https://x.com/vite_js' },
23+
{ icon: 'discord', link: 'https://chat.vite.dev' },
24+
{ icon: 'github', link: 'https://github.com/vitejs/devtools' },
25+
]
26+
1027
// https://vitepress.dev/reference/site-config
11-
export default withMermaid(defineConfig({
28+
export default extendConfig(withMermaid(defineConfig({
1229
title: 'Vite DevTools',
1330
description: 'Visualize and analyze your Vite build process with powerful developer tools. Extensible architecture for building custom DevTools integrations.',
1431
head: [
1532
['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
1633
],
1734
themeConfig: {
35+
variant: 'vite',
36+
1837
// https://vitepress.dev/reference/default-theme-config
1938
nav: [
2039
{ text: 'Guide', link: '/guide/' },
2140
{
2241
text: 'DevTools Kit',
23-
items: [
24-
{ text: 'Introduction', link: '/kit/' },
25-
{ text: 'DevTools Plugin', link: '/kit/devtools-plugin' },
26-
{ text: 'Dock System', link: '/kit/dock-system' },
27-
{ text: 'RPC', link: '/kit/rpc' },
28-
{ text: 'Shared State', link: '/kit/shared-state' },
29-
],
42+
items: DevToolsKitNav,
3043
},
3144
{
3245
text: `v${version}`,
@@ -69,6 +82,22 @@ export default withMermaid(defineConfig({
6982
footer: {
7083
message: `Released under the MIT License.`,
7184
copyright: 'Copyright © 2025-present VoidZero Inc. & Vite Contributors',
85+
nav: [
86+
{
87+
title: 'Vite DevTools',
88+
items: [
89+
{ text: 'Guide', link: '/guide/' },
90+
{ text: 'Features', link: '/guide/features' },
91+
{ text: 'Release Notes', link: 'https://github.com/vitejs/devtools/releases' },
92+
{ text: 'Contributing', link: 'https://github.com/vitejs/devtools/blob/main/CONTRIBUTING.md' },
93+
],
94+
},
95+
{
96+
title: 'DevTools Kit',
97+
items: DevToolsKitNav,
98+
},
99+
],
100+
social: SocialLinks,
72101
},
73102

74103
lastUpdated: {
@@ -80,13 +109,7 @@ export default withMermaid(defineConfig({
80109
text: 'Suggest changes to this page',
81110
},
82111

83-
socialLinks: [
84-
{ icon: 'bluesky', link: 'https://bsky.app/profile/vite.dev' },
85-
{ icon: 'mastodon', link: 'https://elk.zone/m.webtoo.ls/@vite' },
86-
{ icon: 'x', link: 'https://x.com/vite_js' },
87-
{ icon: 'discord', link: 'https://chat.vite.dev' },
88-
{ icon: 'github', link: 'https://github.com/vitejs/devtools' },
89-
],
112+
socialLinks: SocialLinks,
90113
},
91114
markdown: {
92115
codeTransformers: [
@@ -119,4 +142,4 @@ export default withMermaid(defineConfig({
119142
useMaxWidth: true,
120143
},
121144
},
122-
}))
145+
})))

docs/.vitepress/theme/Home.vue

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<script setup>
2+
import FeatureGrid from '@components/oss/FeatureGrid.vue'
3+
import Footer from '@components/oss/Footer.vue'
4+
import HeadingSection from '@components/oss/HeadingSection.vue'
5+
import Hero from '@components/oss/Hero.vue'
6+
import Spacer from '@components/shared/Spacer.vue'
7+
</script>
8+
9+
<template>
10+
<Hero />
11+
12+
<HeadingSection
13+
heading="Inspect, Analyze, Extend"
14+
subheading="Vite DevTools not only provides built-in features, but also a extensible architecture for custom integrations."
15+
/>
16+
17+
<FeatureGrid />
18+
19+
<Spacer />
20+
21+
<Footer
22+
heading="Understand your Vite App Better"
23+
subheading="Visually inspect modules, plugins, chunks, assets, packages..." button-text="Get Started"
24+
button-link="/guide/"
25+
/>
26+
</template>

docs/.vitepress/theme/index.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1+
/// <reference types="vite/client" />
2+
13
import type { Theme } from 'vitepress'
4+
import monoIcon from '@assets/icons/vite-mono.svg'
5+
import footerBg from '@assets/vite/footer-background.jpg'
26
import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
3-
import DefaultTheme from 'vitepress/theme'
7+
import BaseTheme, { themeContextKey } from '@voidzero-dev/vitepress-theme'
48
import 'virtual:group-icons.css'
59
import './styles.css'
610
import '@shikijs/vitepress-twoslash/style.css'
711

812
export default {
9-
extends: DefaultTheme,
13+
extends: BaseTheme,
1014
enhanceApp({ app }) {
1115
app.use(TwoslashFloatingVue)
16+
17+
app.provide(themeContextKey, {
18+
logoDark: '/logo-dark.svg',
19+
logoLight: '/logo-light.svg',
20+
logoAlt: 'Vite Devtools',
21+
footerBg,
22+
monoIcon,
23+
})
1224
},
1325
} satisfies Theme

docs/.vitepress/theme/styles.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
.VPImage.logo {
2-
height: 18px;
3-
}
1+
/* styles.css */
2+
@import "@voidzero-dev/vitepress-theme/src/styles/index.css";
3+
4+
@source "./**/*.vue";
45

56
.mermaid .node rect,
67
.mermaid .node circle,

docs/index.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
layout: home
3+
theme: dark
34

45
hero:
56
name: Vite DevTools
@@ -13,8 +14,7 @@ hero:
1314
text: View on GitHub
1415
link: https://github.com/vitejs/devtools
1516
image:
16-
light: /logo_devtools.svg
17-
dark: /logo_devtools_dark.svg
17+
src: /hero.svg
1818
alt: Vite DevTools
1919

2020
features:
@@ -37,3 +37,9 @@ features:
3737
title: Framework Agnostic
3838
details: Works with any framework built on Vite. Use Vue, React, Svelte, or any other framework to build your DevTools UI.
3939
---
40+
41+
<script setup>
42+
import Home from './.vitepress/theme/Home.vue'
43+
</script>
44+
45+
<Home />

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"devDependencies": {
1111
"@shikijs/vitepress-twoslash": "catalog:docs",
1212
"@vitejs/devtools": "workspace:*",
13+
"@voidzero-dev/vitepress-theme": "catalog:docs",
1314
"mermaid": "catalog:docs",
1415
"vitepress": "catalog:docs",
1516
"vitepress-plugin-group-icons": "catalog:docs",

docs/public/hero.svg

Lines changed: 38 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)