Skip to content

Commit 326d261

Browse files
committed
docs: refactor sidebar
1 parent 3b36268 commit 326d261

File tree

1 file changed

+109
-74
lines changed

1 file changed

+109
-74
lines changed

docs/.vitepress/config.ts

Lines changed: 109 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from 'vitepress'
1+
import { defineConfig, DefaultTheme } from 'vitepress'
22
import { version } from '../../package.json'
33
import {
44
twitter,
@@ -95,7 +95,6 @@ export default defineConfig({
9595
nav: [
9696
{ text: 'Guide', link: '/guide/' },
9797
{ text: 'API', link: '/api/' },
98-
{ text: 'Config', link: '/config/' },
9998
{
10099
text: `v${version}`,
101100
items: [
@@ -117,79 +116,115 @@ export default defineConfig({
117116

118117
sidebar: {
119118
'/': [
120-
{
121-
text: 'Guide',
122-
items: [
123-
{
124-
text: 'Why VueFire',
125-
link: '/guide/',
126-
},
127-
{
128-
text: 'Getting Started',
129-
link: '/guide/getting-started',
130-
},
131-
{
132-
text: 'Realtime Data',
133-
link: '/guide/realtime-data',
134-
},
135-
{
136-
text: 'Options API',
137-
link: '/guide/options-api-realtime-data',
138-
},
139-
{
140-
text: 'Authentication',
141-
link: '/guide/auth',
142-
},
143-
{
144-
text: 'SSR',
145-
link: '/guide/ssr',
146-
},
147-
// NOTE: hide until it works
148-
// {
149-
// text: 'Nuxt',
150-
// link: '/guide/nuxt',
151-
// },
152-
// {
153-
// text: 'Querying the database',
154-
// link: '/guide/querying',
155-
// },
156-
// {
157-
// text: 'Writing to the database',
158-
// link: '/guide/writing-data',
159-
// },
160-
{
161-
text: 'Global Options',
162-
link: '/guide/global-options',
163-
},
164-
],
165-
},
166-
{
167-
text: 'Cookbook',
168-
items: [
169-
{
170-
text: 'Cookbook',
171-
link: '/cookbook/',
172-
},
173-
{
174-
text: 'Migration from VueFire 2',
175-
link: '/cookbook/migration-v2-v3',
176-
},
177-
{
178-
text: 'Binding to existing refs',
179-
link: '/cookbook/subscriptions-external',
180-
},
181-
],
182-
},
183-
{
184-
text: 'API',
185-
items: [
186-
{
187-
text: 'API Reference',
188-
link: '/api/',
189-
},
190-
],
191-
},
119+
//
120+
sidebarGuide(),
121+
sidebarNuxt(),
122+
sidebarCookbook(),
123+
sidebarApi(),
192124
],
193125
},
194126
},
195127
})
128+
129+
type SidebarGroup = DefaultTheme.SidebarGroup
130+
131+
function sidebarGuide(): SidebarGroup {
132+
return {
133+
text: 'Guide',
134+
collapsible: true,
135+
items: [
136+
{
137+
text: 'Why VueFire',
138+
link: '/guide/',
139+
},
140+
{
141+
text: 'Getting Started',
142+
link: '/guide/getting-started',
143+
},
144+
{
145+
text: 'Realtime Data',
146+
link: '/guide/realtime-data',
147+
},
148+
{
149+
text: 'Options API',
150+
link: '/guide/options-api-realtime-data',
151+
},
152+
{
153+
text: 'Authentication',
154+
link: '/guide/auth',
155+
},
156+
{
157+
text: 'SSR',
158+
link: '/guide/ssr',
159+
},
160+
// NOTE: hide until it works
161+
// {
162+
// text: 'Nuxt',
163+
// link: '/guide/nuxt',
164+
// },
165+
// {
166+
// text: 'Querying the database',
167+
// link: '/guide/querying',
168+
// },
169+
// {
170+
// text: 'Writing to the database',
171+
// link: '/guide/writing-data',
172+
// },
173+
{
174+
text: 'Global Options',
175+
link: '/guide/global-options',
176+
},
177+
],
178+
}
179+
}
180+
181+
function sidebarNuxt(): SidebarGroup {
182+
return {
183+
collapsible: true,
184+
text: 'Nuxt',
185+
items: [
186+
{
187+
text: 'Getting Started',
188+
link: '/nuxt/getting-started',
189+
},
190+
{
191+
text: 'Config',
192+
link: '/nuxt/config',
193+
},
194+
],
195+
}
196+
}
197+
198+
function sidebarCookbook(): SidebarGroup {
199+
return {
200+
collapsible: true,
201+
text: 'Cookbook',
202+
items: [
203+
{
204+
text: 'Cookbook',
205+
link: '/cookbook/',
206+
},
207+
{
208+
text: 'Migration from VueFire 2',
209+
link: '/cookbook/migration-v2-v3',
210+
},
211+
{
212+
text: 'Binding to existing refs',
213+
link: '/cookbook/subscriptions-external',
214+
},
215+
],
216+
}
217+
}
218+
219+
function sidebarApi(): SidebarGroup {
220+
return {
221+
collapsible: false,
222+
text: 'API',
223+
items: [
224+
{
225+
text: 'API Reference',
226+
link: '/api/',
227+
},
228+
],
229+
}
230+
}

0 commit comments

Comments
 (0)