Skip to content

Commit e514bd3

Browse files
authored
Update config.mts
1 parent 6014082 commit e514bd3

File tree

1 file changed

+70
-15
lines changed

1 file changed

+70
-15
lines changed

docs/.vitepress/config.mts

Lines changed: 70 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from 'vitepress'
1+
import { defineConfig, type DefaultTheme } from 'vitepress'
22

33
// https://vitepress.dev/reference/site-config
44
export default defineConfig({
@@ -7,24 +7,79 @@ export default defineConfig({
77
description: "Supercharge Excel generation in PHP with Rust's blazing speed!",
88
themeConfig: {
99
// https://vitepress.dev/reference/default-theme-config
10-
nav: [
11-
{ text: 'PHP', link: '/php-readme' },
12-
{ text: 'Symfony Bundle', link: '/symfony-bundle' },
13-
{ text: 'Rust', link: '/rust-excel' }
14-
],
10+
nav: nav(),
1511

16-
sidebar: [
17-
{
18-
text: 'PHP',
19-
items: [
20-
{ text: 'Markdown Examples', link: '/markdown-examples' },
21-
{ text: 'Runtime API Examples', link: '/api-examples' }
22-
]
23-
}
24-
],
12+
sidebar: {
13+
'/php/': { base: '/php/', items: sidebarPhp() },
14+
'/symfony/': { base: '/symfony/', items: sidebarReference() }
15+
},
2516

2617
socialLinks: [
2718
{ icon: 'github', link: 'https://github.com/SpiriitLabs/php-excel-rust' }
2819
]
2920
}
3021
})
22+
23+
24+
function nav(): DefaultTheme.NavItem[] {
25+
return [
26+
{
27+
text: 'PHP',
28+
link: '/php/php-readme',
29+
activeMatch: '/php/'
30+
},
31+
{
32+
text: 'Symfony Bundle',
33+
link: '/symfony/symfony-bundle',
34+
activeMatch: '/symfony/'
35+
}
36+
]
37+
}
38+
39+
function sidebarPhp(): DefaultTheme.SidebarItem[] {
40+
return [
41+
{
42+
text: 'Introduction',
43+
collapsed: false,
44+
items: [
45+
{ text: 'What is VitePress?', link: 'what-is-vitepress' },
46+
{ text: 'Getting Started', link: 'getting-started' },
47+
{ text: 'Routing', link: 'routing' },
48+
{ text: 'Deploy', link: 'deploy' }
49+
]
50+
}
51+
]
52+
}
53+
54+
function sidebarReference(): DefaultTheme.SidebarItem[] {
55+
return [
56+
{
57+
text: 'Reference',
58+
items: [
59+
{ text: 'Site Config', link: 'site-config' },
60+
{ text: 'Frontmatter Config', link: 'frontmatter-config' },
61+
{ text: 'Runtime API', link: 'runtime-api' },
62+
{ text: 'CLI', link: 'cli' },
63+
{
64+
text: 'Default Theme',
65+
base: '/reference/default-theme-',
66+
items: [
67+
{ text: 'Overview', link: 'config' },
68+
{ text: 'Nav', link: 'nav' },
69+
{ text: 'Sidebar', link: 'sidebar' },
70+
{ text: 'Home Page', link: 'home-page' },
71+
{ text: 'Footer', link: 'footer' },
72+
{ text: 'Layout', link: 'layout' },
73+
{ text: 'Badge', link: 'badge' },
74+
{ text: 'Team Page', link: 'team-page' },
75+
{ text: 'Prev / Next Links', link: 'prev-next-links' },
76+
{ text: 'Edit Link', link: 'edit-link' },
77+
{ text: 'Last Updated Timestamp', link: 'last-updated' },
78+
{ text: 'Search', link: 'search' },
79+
{ text: 'Carbon Ads', link: 'carbon-ads' }
80+
]
81+
}
82+
]
83+
}
84+
]
85+
}

0 commit comments

Comments
 (0)