|
1 | | -import { defineConfig } from 'vitepress'; |
| 1 | +import { defineConfig, postcssIsolateStyles } from 'vitepress'; |
| 2 | + |
| 3 | +// Badge HTML helper |
| 4 | +function BadgeHTML(text: string, type: 'new' | 'updated' | 'beta' = 'new') { |
| 5 | + const classMap = { |
| 6 | + new: 'vp-badge-new', |
| 7 | + updated: 'vp-badge-updated', |
| 8 | + beta: 'vp-badge-updated', |
| 9 | + }; |
| 10 | + |
| 11 | + return `<span class="${classMap[type]}">${text}</span>`; |
| 12 | +} |
2 | 13 |
|
3 | 14 | // https://vitepress.dev/reference/site-config |
4 | 15 | export default defineConfig({ |
@@ -77,29 +88,30 @@ export default defineConfig({ |
77 | 88 | text: 'Components', |
78 | 89 | items: [ |
79 | 90 | { text: 'Overview', link: '/components/' }, |
| 91 | + { text: 'Accordion', link: '/components/accordion' }, |
| 92 | + { text: 'Alert', link: '/components/alert' }, |
| 93 | + { text: 'AspectRatio', link: '/components/aspect-ratio' }, |
| 94 | + { text: `Avatar ${BadgeHTML('New', 'new')}`, link: '/components/avatar' }, |
| 95 | + { text: `Badge ${BadgeHTML('Updated', 'updated')}`, link: '/components/badge' }, |
| 96 | + { text: 'Breadcrumb', link: '/components/breadcrumb' }, |
80 | 97 | { text: 'Button', link: '/components/button' }, |
81 | | - { text: 'Input', link: '/components/input' }, |
82 | | - { text: 'Textarea', link: '/components/textarea' }, |
83 | | - { text: 'RadioGroup', link: '/components/radio-group' }, |
84 | 98 | { text: 'Button Group', link: '/components/button-group' }, |
85 | | - { text: 'Badge', link: '/components/badge' }, |
| 99 | + { text: 'Calendar', link: '/components/calendar' }, |
| 100 | + { text: 'Comparison', link: '/components/comparison' }, |
| 101 | + { text: 'Divider', link: '/components/divider' }, |
| 102 | + { text: `Icon ${BadgeHTML('New', 'new')}`, link: '/components/icon' }, |
| 103 | + { text: 'Input', link: '/components/input' }, |
86 | 104 | { text: 'Kbd', link: '/components/kbd' }, |
87 | | - { text: 'Breadcrumb', link: '/components/breadcrumb' }, |
88 | 105 | { text: 'Pagination', link: '/components/pagination' }, |
| 106 | + { text: 'Progress', link: '/components/progress' }, |
| 107 | + { text: 'Range', link: '/components/range' }, |
| 108 | + { text: `RadioGroup ${BadgeHTML('New', 'new')}`, link: '/components/radio-group' }, |
| 109 | + { text: 'Rating', link: '/components/rating' }, |
89 | 110 | { text: 'Skeleton', link: '/components/skeleton' }, |
90 | | - { text: 'Divider', link: '/components/divider' }, |
91 | | - { text: 'Icon', link: '/components/icon' }, |
92 | | - { text: 'Alert', link: '/components/alert' }, |
93 | | - { text: 'AspectRatio', link: '/components/aspect-ratio' }, |
94 | | - { text: 'Accordion', link: '/components/accordion' }, |
95 | | - { text: 'Tabs', link: '/components/tabs' }, |
96 | | - { text: 'Calendar', link: '/components/calendar' }, |
97 | 111 | { text: 'Stepper', link: '/components/stepper' }, |
98 | 112 | { text: 'Switch', link: '/components/switch' }, |
99 | | - { text: 'Range', link: '/components/range' }, |
100 | | - { text: 'Rating', link: '/components/rating' }, |
101 | | - { text: 'Progress', link: '/components/progress' }, |
102 | | - { text: 'Comparison', link: '/components/comparison' }, |
| 113 | + { text: 'Tabs', link: '/components/tabs' }, |
| 114 | + { text: 'Textarea', link: '/components/textarea' }, |
103 | 115 | { text: 'Tooltip', link: '/components/tooltip' }, |
104 | 116 | { text: 'Tour', link: '/components/tour' }, |
105 | 117 | ], |
@@ -148,29 +160,30 @@ export default defineConfig({ |
148 | 160 | text: 'Компоненты', |
149 | 161 | items: [ |
150 | 162 | { text: 'Обзор', link: '/ru/components/' }, |
| 163 | + { text: 'Accordion', link: '/ru/components/accordion' }, |
| 164 | + { text: 'Alert', link: '/ru/components/alert' }, |
| 165 | + { text: 'AspectRatio', link: '/ru/components/aspect-ratio' }, |
| 166 | + { text: `Avatar ${BadgeHTML('Новый', 'new')}`, link: '/ru/components/avatar' }, |
| 167 | + { text: `Badge ${BadgeHTML('Обновлен', 'updated')}`, link: '/ru/components/badge' }, |
| 168 | + { text: 'Breadcrumb', link: '/ru/components/breadcrumb' }, |
151 | 169 | { text: 'Button', link: '/ru/components/button' }, |
152 | | - { text: 'Input', link: '/ru/components/input' }, |
153 | | - { text: 'Textarea', link: '/ru/components/textarea' }, |
154 | | - { text: 'RadioGroup', link: '/ru/components/radio-group' }, |
155 | 170 | { text: 'Button Group', link: '/ru/components/button-group' }, |
156 | | - { text: 'Badge', link: '/ru/components/badge' }, |
| 171 | + { text: 'Calendar', link: '/ru/components/calendar' }, |
| 172 | + { text: 'Comparison', link: '/ru/components/comparison' }, |
| 173 | + { text: 'Divider', link: '/ru/components/divider' }, |
| 174 | + { text: `Icon ${BadgeHTML('Новый', 'new')}`, link: '/ru/components/icon' }, |
| 175 | + { text: 'Input', link: '/ru/components/input' }, |
157 | 176 | { text: 'Kbd', link: '/ru/components/kbd' }, |
158 | | - { text: 'Breadcrumb', link: '/ru/components/breadcrumb' }, |
159 | 177 | { text: 'Pagination', link: '/ru/components/pagination' }, |
| 178 | + { text: 'Progress', link: '/ru/components/progress' }, |
| 179 | + { text: 'Range', link: '/ru/components/range' }, |
| 180 | + { text: `RadioGroup ${BadgeHTML('Новый', 'new')}`, link: '/ru/components/radio-group' }, |
| 181 | + { text: 'Rating', link: '/ru/components/rating' }, |
160 | 182 | { text: 'Skeleton', link: '/ru/components/skeleton' }, |
161 | | - { text: 'Divider', link: '/ru/components/divider' }, |
162 | | - { text: 'Icon', link: '/ru/components/icon' }, |
163 | | - { text: 'Alert', link: '/ru/components/alert' }, |
164 | | - { text: 'AspectRatio', link: '/ru/components/aspect-ratio' }, |
165 | | - { text: 'Accordion', link: '/ru/components/accordion' }, |
166 | | - { text: 'Tabs', link: '/ru/components/tabs' }, |
167 | | - { text: 'Calendar', link: '/ru/components/calendar' }, |
168 | 183 | { text: 'Stepper', link: '/ru/components/stepper' }, |
169 | 184 | { text: 'Switch', link: '/ru/components/switch' }, |
170 | | - { text: 'Range', link: '/ru/components/range' }, |
171 | | - { text: 'Rating', link: '/ru/components/rating' }, |
172 | | - { text: 'Progress', link: '/ru/components/progress' }, |
173 | | - { text: 'Comparison', link: '/ru/components/comparison' }, |
| 185 | + { text: 'Tabs', link: '/ru/components/tabs' }, |
| 186 | + { text: 'Textarea', link: '/ru/components/textarea' }, |
174 | 187 | { text: 'Tooltip', link: '/ru/components/tooltip' }, |
175 | 188 | { text: 'Tour', link: '/ru/components/tour' }, |
176 | 189 | ], |
@@ -211,4 +224,14 @@ export default defineConfig({ |
211 | 224 | copyright: 'Copyright © 2025-present Alexander Zhukov', |
212 | 225 | }, |
213 | 226 | }, |
| 227 | + |
| 228 | + vite: { |
| 229 | + css: { |
| 230 | + postcss: { |
| 231 | + plugins: [ |
| 232 | + postcssIsolateStyles({ includeFiles: [/vp-doc\.css/] }), |
| 233 | + ], |
| 234 | + }, |
| 235 | + }, |
| 236 | + }, |
214 | 237 | }); |
0 commit comments