Skip to content

Commit e4e0acb

Browse files
committed
docs: update structure
1 parent fa03fb3 commit e4e0acb

File tree

172 files changed

+182
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+182
-173
lines changed

docs/.vuepress/config.ts

+51-50
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import pkg from '../../package.json'
77
const path = require('path')
88

99
export default defineUserConfig<DefaultThemeOptions>({
10+
base: `/vue/docs/${pkg.config.version_short}/`,
1011
lang: 'en-US',
1112
title: 'CoreUI for Vue.js',
1213
description: 'UI Components Library for Vue.js (Vue 3)',
@@ -71,180 +72,180 @@ export default defineUserConfig<DefaultThemeOptions>({
7172
{
7273
text: 'Getting started',
7374
icon: '<rect width="32" height="32" x="144" y="464" fill="var(--ci-primary-color, currentColor)" class="ci-primary"></rect><rect width="32" height="32" x="240" y="464" fill="var(--ci-primary-color, currentColor)" class="ci-primary"></rect><rect width="32" height="32" x="336" y="464" fill="var(--ci-primary-color, currentColor)" class="ci-primary"></rect><path fill="var(--ci-primary-color, currentColor)" d="M312,76.82v34.265a142.419,142.419,0,0,1,86.207,130.708C398.207,320.206,334.413,384,256,384S113.793,320.206,113.793,241.793A142.419,142.419,0,0,1,200,111.085V76.82c-68.671,23.373-118.207,88.5-118.207,164.973C81.793,337.851,159.942,416,256,416s174.207-78.149,174.207-174.207C430.207,165.316,380.671,100.193,312,76.82Z" class="ci-primary"></path><rect width="32" height="229.793" x="240" y="16" fill="var(--ci-primary-color, currentColor)" class="ci-primary"></rect>',
74-
link: `/${pkg.config.version_short}/getting-started/`,
75+
link: `/getting-started/`,
7576
children: [
7677
{
7778
text: 'Introduction',
78-
link: `/${pkg.config.version_short}/getting-started/introduction.html`,
79+
link: `/getting-started/introduction.html`,
7980
},
8081
],
8182
},
8283
{
8384
text: 'Layout',
8485
icon: `<path fill="var(--ci-primary-color, currentColor)" d="M16,64V448H496V64ZM464,240H192V96H464ZM192,272H312V416H192ZM48,96H160V416H48ZM344,416V272H464V416Z"></path>`,
85-
link: `/${pkg.config.version_short}/layout/`,
86+
link: `/layout/`,
8687
children: [
8788
{
8889
text: 'Breakpoints',
89-
link: `/${pkg.config.version_short}/layout/breakpoints.html`,
90+
link: `/layout/breakpoints.html`,
9091
},
9192
{
9293
text: 'Columns',
93-
link: `/${pkg.config.version_short}/layout/columns.html`,
94+
link: `/layout/columns.html`,
9495
},
9596
{
9697
text: 'Containers',
97-
link: `/${pkg.config.version_short}/layout/containers.html`,
98+
link: `/layout/containers.html`,
9899
},
99100
{
100101
text: 'Grid',
101-
link: `/${pkg.config.version_short}/layout/grid.html`,
102+
link: `/layout/grid.html`,
102103
},
103104
{
104105
text: 'Gutters',
105-
link: `/${pkg.config.version_short}/layout/gutters.html`,
106+
link: `/layout/gutters.html`,
106107
},
107108
],
108109
},
109110
{
110111
text: 'Forms',
111112
icon: `<rect width="288" height="32" x="112" y="152" fill="var(--ci-primary-color, currentColor)" class="ci-primary"></rect><rect width="288" height="32" x="112" y="240" fill="var(--ci-primary-color, currentColor)" class="ci-primary"></rect><rect width="152" height="32" x="112" y="328" fill="var(--ci-primary-color, currentColor)" class="ci-primary"></rect><path fill="var(--ci-primary-color, currentColor)" d="M480,48H32V464H480ZM448,432H64V80H448Z" class="ci-primary"></path>`,
112-
link: `/${pkg.config.version_short}/forms/`,
113+
link: `/forms/`,
113114
children: [
114115
{
115116
text: 'Overview',
116-
link: `/${pkg.config.version_short}/forms/overview.html`,
117+
link: `/forms/overview.html`,
117118
},
118119
{
119120
text: 'Form control',
120-
link: `/${pkg.config.version_short}/forms/form-control.html`,
121+
link: `/forms/form-control.html`,
121122
},
122123
{
123124
text: 'Select',
124-
link: `/${pkg.config.version_short}/forms/select.html`,
125+
link: `/forms/select.html`,
125126
},
126127
{
127128
text: 'Checks & radios',
128-
link: `/${pkg.config.version_short}/forms/checks-radios.html`,
129+
link: `/forms/checks-radios.html`,
129130
},
130131
{
131132
text: 'Range',
132-
link: `/${pkg.config.version_short}/forms/range.html`,
133+
link: `/forms/range.html`,
133134
},
134135
{
135136
text: 'Floating labels',
136-
link: `/${pkg.config.version_short}/forms/floating-labels.html`,
137+
link: `/forms/floating-labels.html`,
137138
},
138139
{
139140
text: 'Input group',
140-
link: `/${pkg.config.version_short}/forms/input-group.html`,
141+
link: `/forms/input-group.html`,
141142
},
142143
{
143144
text: 'Layout',
144-
link: `/${pkg.config.version_short}/forms/layout.html`,
145+
link: `/forms/layout.html`,
145146
},
146147
{
147148
text: 'Validation',
148-
link: `/${pkg.config.version_short}/forms/validation.html`,
149+
link: `/forms/validation.html`,
149150
},
150151
],
151152
},
152153
{
153154
text: 'Components',
154155
icon: '<path fill="var(--ci-primary-color, currentColor)" d="M410.989,16H101.011L16,237.029V496H496V237.029Zm-288,32H240V240H49.143ZM184,272H328v40H184ZM464,464H48V272H152v72H360V272H464ZM272,240V48H389.012l73.845,192Z" class="ci-primary"></path>',
155-
link: `/${pkg.config.version_short}/components/`,
156+
link: `/components/`,
156157
children: [
157158
{
158159
text: 'Accordion',
159-
link: `/${pkg.config.version_short}/components/accordion.html`,
160+
link: `/components/accordion.html`,
160161
},
161162
{
162163
text: 'Alert',
163-
link: `/${pkg.config.version_short}/components/alert.html`,
164+
link: `/components/alert.html`,
164165
},
165166
{
166167
text: 'Avatar',
167-
link: `/${pkg.config.version_short}/components/avatar.html`,
168+
link: `/components/avatar.html`,
168169
},
169170
{
170171
text: 'Badge',
171-
link: `/${pkg.config.version_short}/components/badge.html`,
172+
link: `/components/badge.html`,
172173
},
173174
{
174175
text: 'Breadcrumb',
175-
link: `/${pkg.config.version_short}/components/breadcrumb.html`,
176+
link: `/components/breadcrumb.html`,
176177
},
177178
{
178179
text: 'Buttons',
179-
link: `/${pkg.config.version_short}/components/button.html`,
180+
link: `/components/button.html`,
180181
},
181182
{
182183
text: 'Button Group',
183-
link: `/${pkg.config.version_short}/components/button-group.html`,
184+
link: `/components/button-group.html`,
184185
},
185186
{
186187
text: 'Callout',
187-
link: `/${pkg.config.version_short}/components/callout.html`,
188+
link: `/components/callout.html`,
188189
},
189190
{
190191
text: 'Card',
191-
link: `/${pkg.config.version_short}/components/card.html`,
192+
link: `/components/card.html`,
192193
},
193194
{
194195
text: 'Carousel',
195-
link: `/${pkg.config.version_short}/components/carousel.html`,
196+
link: `/components/carousel.html`,
196197
},
197198
{
198199
text: 'Close Button',
199-
link: `/${pkg.config.version_short}/components/close-button.html`,
200+
link: `/components/close-button.html`,
200201
},
201202
{
202203
text: 'Collapse',
203-
link: `/${pkg.config.version_short}/components/collapse.html`,
204+
link: `/components/collapse.html`,
204205
},
205206
{
206207
text: 'Dropdown',
207-
link: `/${pkg.config.version_short}/components/dropdown.html`,
208+
link: `/components/dropdown.html`,
208209
},
209210
{
210211
text: 'Footer',
211-
link: `/${pkg.config.version_short}/components/footer.html`,
212+
link: `/components/footer.html`,
212213
},
213214
{
214215
text: 'Header',
215-
link: `/${pkg.config.version_short}/components/header.html`,
216+
link: `/components/header.html`,
216217
},
217218
{
218219
text: 'Image',
219-
link: `/${pkg.config.version_short}/components/image.html`,
220+
link: `/components/image.html`,
220221
},
221222
{
222223
text: 'List Group',
223-
link: `/${pkg.config.version_short}/components/list-group.html`,
224+
link: `/components/list-group.html`,
224225
},
225226
{
226227
text: 'Modal',
227-
link: `/${pkg.config.version_short}/components/modal.html`,
228+
link: `/components/modal.html`,
228229
},
229230
{
230231
text: 'Nav',
231-
link: `/${pkg.config.version_short}/components/nav.html`,
232+
link: `/components/nav.html`,
232233
},
233234
{
234235
text: 'Navbar',
235-
link: `/${pkg.config.version_short}/components/navbar.html`,
236+
link: `/components/navbar.html`,
236237
},
237238
{
238239
text: 'Offcanvas',
239-
link: `/${pkg.config.version_short}/components/offcanvas.html`,
240+
link: `/components/offcanvas.html`,
240241
},
241242
{
242243
text: 'Pagination',
243-
link: `/${pkg.config.version_short}/components/pagination.html`,
244+
link: `/components/pagination.html`,
244245
},
245246
{
246247
text: 'Placeholders',
247-
link: `/${pkg.config.version_short}/components/placeholders.html`,
248+
link: `/components/placeholders.html`,
248249
disabled: true,
249250
badge: {
250251
color: 'warning',
@@ -253,35 +254,35 @@ export default defineUserConfig<DefaultThemeOptions>({
253254
},
254255
{
255256
text: 'Popover',
256-
link: `/${pkg.config.version_short}/components/popover.html`,
257+
link: `/components/popover.html`,
257258
},
258259
{
259260
text: 'Progress',
260-
link: `/${pkg.config.version_short}/components/progress.html`,
261+
link: `/components/progress.html`,
261262
},
262263
{
263264
text: 'Sidebar',
264-
link: `/${pkg.config.version_short}/components/sidebar.html`,
265+
link: `/components/sidebar.html`,
265266
},
266267
{
267268
text: 'Spinner',
268-
link: `/${pkg.config.version_short}/components/spinner.html`,
269+
link: `/components/spinner.html`,
269270
},
270271
{
271272
text: 'Table',
272-
link: `/${pkg.config.version_short}/components/table.html`,
273+
link: `/components/table.html`,
273274
},
274275
{
275276
text: 'Toast',
276-
link: `/${pkg.config.version_short}/components/toast.html`,
277+
link: `/components/toast.html`,
277278
},
278279
{
279280
text: 'Tooltip',
280-
link: `/${pkg.config.version_short}/components/tooltip.html`,
281+
link: `/components/tooltip.html`,
281282
},
282283
{
283284
text: 'Widgets',
284-
link: `/${pkg.config.version_short}/components/widgets.html`,
285+
link: `/components/widgets.html`,
285286
},
286287
],
287288
},

docs/.vuepress/theme-coreui/src/client/clientAppEnhance.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ export default defineClientAppEnhance(({ app, router }) => {
2020

2121
// compat with @vuepress/plugin-docsearch and @vuepress/plugin-search
2222
app.component('NavbarSearch', () => {
23-
const SearchComponent =
24-
app.component('Docsearch') || app.component('SearchBox')
23+
const SearchComponent = app.component('Docsearch') || app.component('SearchBox')
2524
if (SearchComponent) {
2625
return h(SearchComponent)
2726
}
@@ -30,8 +29,9 @@ export default defineClientAppEnhance(({ app, router }) => {
3029

3130
// handle scrollBehavior with transition
3231
const scrollBehavior = router.options.scrollBehavior!
33-
router.options.scrollBehavior = async (...args) => {
32+
;(router.options.scrollBehavior = async (...args) => {
3433
await useScrollPromise().wait()
3534
return scrollBehavior(...args)
36-
}
35+
}),
36+
router.addRoute({ path: '/', redirect: '/getting-started/introduction.html' })
3737
})

docs/.vuepress/theme-coreui/src/client/components/SidebarNav.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { RouterLink, useRoute } from 'vue-router'
44
import type { RouteLocationNormalizedLoaded } from 'vue-router'
55
import type { ResolvedSidebarItem } from '../../shared'
66

7+
import { withBase } from '@vuepress/client'
8+
79
import { CBadge, CNavGroup, CNavItem, CSidebarNav } from './../../../../../../src'
810
import { CIcon } from '@coreui/icons-vue'
911

@@ -77,7 +79,7 @@ const renderItem = (item: ResolvedSidebarItem): VNode => {
7779
{
7880
active: props.isActive,
7981
disabled: item.disabled,
80-
href: item.link,
82+
href: withBase(item.link),
8183
},
8284
{
8385
default: () => [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template></template>
2+
3+
<script>
4+
export default {
5+
mounted() {
6+
this.$router.push('/getting-started/introduction.html')
7+
},
8+
}
9+
</script>

docs/README.md

+1-4

docs/4.0/components/accordion.md renamed to docs/components/accordion.md

+3-3

docs/4.0/components/alert.md renamed to docs/components/alert.md

+2-2

docs/4.0/components/avatar.md renamed to docs/components/avatar.md

+5-5

0 commit comments

Comments
 (0)