Skip to content

Commit

Permalink
docs: refactor doc config
Browse files Browse the repository at this point in the history
  • Loading branch information
wxsms committed Nov 16, 2021
1 parent fc41ef4 commit 393676a
Showing 1 changed file with 97 additions and 91 deletions.
188 changes: 97 additions & 91 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import vueJsx from '@vitejs/plugin-vue-jsx'
import { defineConfig } from 'vitepress'

export default {
export default defineConfig({
description: 'Bootstrap 3 components implemented by Vue.',
head: [
[
Expand Down Expand Up @@ -31,100 +32,105 @@ export default {
docsBranch: 'dev',
editLinks: true,
editLinkText: 'Edit this page on GitHub',
nav: [
{ text: 'Home', link: '/' },
{
text: 'Usage',
link: '/usage/getting-started',
activeMatch: '^/usage/',
},
{
text: 'Components',
link: '/components/btn',
activeMatch: '^/components/',
},
{ text: '1.x', link: 'https://uiv-v1.wxsm.space' },
{ text: '0.x', link: 'https://uiv-v0.wxsm.space' },
{ text: 'Funding', link: '/funding/' },
{ text: 'Changelog', link: 'https://github.com/uiv-lib/uiv/releases' },
],
nav: navbar(),
sidebar: {
'/usage': [
{ text: 'Getting Started', link: '/usage/getting-started' },
{
text: 'i18n',
link: '/usage/i18n',
},
],
'/components': [
{
text: 'Basic',
collapsable: false,
children: [
{ text: 'Button', link: '/components/btn' },
{ text: 'Button Group', link: '/components/btn-group' },
{ text: 'Collapse', link: '/components/collapse' },
],
},
{
text: 'Popup',
collapsable: false,
children: [
{ text: 'Dropdown', link: '/components/dropdown' },
{ text: 'Modal', link: '/components/modal' },
{ text: 'Tooltip', link: '/components/tooltip' },
{ text: 'Popover', link: '/components/popover' },
],
},
{
text: 'Form',
collapsable: false,
children: [
{ text: 'Multi Select', link: '/components/multi-select' },
{ text: 'Typeahead', link: '/components/typeahead' },
{ text: 'Date Picker', link: '/components/date-picker' },
{ text: 'Time Picker', link: '/components/time-picker' },
],
},
{
text: 'Notice',
collapsable: false,
children: [
{ text: 'Alert', link: '/components/alert' },
{ text: 'Notification', link: '/components/notification' },
{ text: 'Message Box', link: '/components/message-box' },
],
},
{
text: 'Navigation',
collapsable: false,
children: [
{ text: 'Navbar', link: '/components/navbar' },
{ text: 'Tabs', link: '/components/tabs' },
{ text: 'Breadcrumbs', link: '/components/breadcrumbs' },
],
},
{
text: 'Indicator',
collapsable: false,
children: [
{ text: 'Pagination', link: '/components/pagination' },
{ text: 'Progress Bar', link: '/components/progress-bar' },
],
},
{
text: 'Others',
collapsable: false,
children: [
{ text: 'Carousel', link: '/components/carousel' },
{ text: 'Affix', link: '/components/affix' },
{ text: 'Scroll Spy', link: '/components/scroll-spy' },
],
},
],
'/usage': usageSidebar(),
'/components': componentSidebar(),
},
},
vite: {
plugins: [vueJsx()],
},
})

function navbar() {
return [
{ text: 'Home', link: '/' },
{
text: 'Usage',
link: '/usage/getting-started',
activeMatch: '^/usage/',
},
{
text: 'Components',
link: '/components/btn',
activeMatch: '^/components/',
},
{ text: '1.x', link: 'https://uiv-v1.wxsm.space' },
{ text: '0.x', link: 'https://uiv-v0.wxsm.space' },
{ text: 'Funding', link: '/funding/' },
{ text: 'Changelog', link: 'https://github.com/uiv-lib/uiv/releases' },
]
}

function usageSidebar() {
return [
{ text: 'Getting Started', link: '/usage/getting-started' },
{
text: 'i18n',
link: '/usage/i18n',
},
]
}

function componentSidebar() {
return [
{
text: 'Basic',
children: [
{ text: 'Button', link: '/components/btn' },
{ text: 'Button Group', link: '/components/btn-group' },
{ text: 'Collapse', link: '/components/collapse' },
],
},
{
text: 'Popup',
children: [
{ text: 'Dropdown', link: '/components/dropdown' },
{ text: 'Modal', link: '/components/modal' },
{ text: 'Tooltip', link: '/components/tooltip' },
{ text: 'Popover', link: '/components/popover' },
],
},
{
text: 'Form',
children: [
{ text: 'Multi Select', link: '/components/multi-select' },
{ text: 'Typeahead', link: '/components/typeahead' },
{ text: 'Date Picker', link: '/components/date-picker' },
{ text: 'Time Picker', link: '/components/time-picker' },
],
},
{
text: 'Notice',
children: [
{ text: 'Alert', link: '/components/alert' },
{ text: 'Notification', link: '/components/notification' },
{ text: 'Message Box', link: '/components/message-box' },
],
},
{
text: 'Navigation',
children: [
{ text: 'Navbar', link: '/components/navbar' },
{ text: 'Tabs', link: '/components/tabs' },
{ text: 'Breadcrumbs', link: '/components/breadcrumbs' },
],
},
{
text: 'Indicator',
children: [
{ text: 'Pagination', link: '/components/pagination' },
{ text: 'Progress Bar', link: '/components/progress-bar' },
],
},
{
text: 'Others',
children: [
{ text: 'Carousel', link: '/components/carousel' },
{ text: 'Affix', link: '/components/affix' },
{ text: 'Scroll Spy', link: '/components/scroll-spy' },
],
},
]
}

0 comments on commit 393676a

Please sign in to comment.