|
| 1 | +import { defineConfig } from 'vitepress' |
| 2 | +import { getRulesWithCategories } from '../../scripts/lib/rules' |
| 3 | +import '../../scripts/update-rule-docs' |
| 4 | +import '../../scripts/update-index-docs' |
| 5 | + |
| 6 | +// https://vitepress.dev/reference/site-config |
| 7 | +export default async () => { |
| 8 | + const rules = await getRulesWithCategories() |
| 9 | + return defineConfig({ |
| 10 | + base: '/', |
| 11 | + title: 'eslint-plugin-vue-i18n', |
| 12 | + description: 'ESLint plugin for Vue I18n', |
| 13 | + head: [['meta', { name: 'theme-color', content: '#3eaf7c' }]], |
| 14 | + lastUpdated: true, |
| 15 | + themeConfig: { |
| 16 | + editLink: { |
| 17 | + pattern: |
| 18 | + 'https://github.com/intlify/eslint-plugin-vue-i18n/edit/master/docs/:path', |
| 19 | + text: 'Edit this page on GitHub' |
| 20 | + }, |
| 21 | + nav: [ |
| 22 | + { |
| 23 | + text: 'Support Intlify', |
| 24 | + items: [ |
| 25 | + { |
| 26 | + text: 'GitHub Sponsors', |
| 27 | + link: 'https://github.com/sponsors/kazupon' |
| 28 | + }, |
| 29 | + { |
| 30 | + text: 'Patreon', |
| 31 | + link: 'https://www.patreon.com/kazupon' |
| 32 | + } |
| 33 | + ] |
| 34 | + }, |
| 35 | + { |
| 36 | + text: 'Release Notes', |
| 37 | + link: 'https://github.com/intlify/eslint-plugin-vue-i18n/releases' |
| 38 | + } |
| 39 | + ], |
| 40 | + sidebar: [ |
| 41 | + { |
| 42 | + text: 'Introduction', |
| 43 | + link: '/intro' |
| 44 | + }, |
| 45 | + { |
| 46 | + text: 'Getting Started', |
| 47 | + link: '/started' |
| 48 | + }, |
| 49 | + { |
| 50 | + text: 'Available Rules', |
| 51 | + link: '/rules/' |
| 52 | + }, |
| 53 | + ...rules.map(({ category, rules }) => ({ |
| 54 | + text: `Rules in ${category}`, |
| 55 | + collapsed: false, |
| 56 | + items: rules.map(rule => ({ |
| 57 | + text: rule.name, |
| 58 | + link: `/rules/${rule.name}` |
| 59 | + })) |
| 60 | + })) |
| 61 | + ], |
| 62 | + socialLinks: [ |
| 63 | + { |
| 64 | + icon: 'github', |
| 65 | + link: 'https://github.com/intlify/eslint-plugin-vue-i18n' |
| 66 | + } |
| 67 | + ] |
| 68 | + } |
| 69 | + }) |
| 70 | +} |
0 commit comments