|
1 | | -import { defineConfig, type UserConfig } from 'vitepress' |
2 | | -import { withSidebar } from 'vitepress-sidebar'; |
3 | | -import { type VitePressSidebarOptions } from 'vitepress-sidebar/types'; |
4 | | -import { withI18n } from 'vitepress-i18n'; |
5 | | -import { type VitePressI18nOptions } from 'vitepress-i18n/types'; |
| 1 | +import { defineConfig } from 'vitepress' |
6 | 2 |
|
7 | | -// Base VitePress configuration |
8 | | -const vitePressConfig: UserConfig = { |
| 3 | +// Uncomment for local tests |
| 4 | +//const BASE = '/' |
| 5 | +const BASE = `/mikros-docs/` |
| 6 | + |
| 7 | +export default defineConfig({ |
| 8 | + srcDir: 'src', |
| 9 | + base: BASE, |
| 10 | + |
| 11 | + lang: 'en-US', |
9 | 12 | title: 'Mikros', |
10 | | - description: 'Mikros docs', |
11 | | - srcDir: './src', |
12 | | - assetsDir: './public', |
13 | | - rewrites: { |
14 | | - 'en/:rest*': ':rest*' |
15 | | - }, |
16 | | - base: '/', |
17 | | - ignoreDeadLinks: true, |
18 | | - head: [ |
19 | | - ['link', { rel: 'icon', href: '/favicon.ico' }] |
20 | | - ], |
| 13 | + description: 'An opinionated framework for Go and Rust services', |
| 14 | + |
21 | 15 | themeConfig: { |
22 | 16 | logo: 'https://avatars.githubusercontent.com/u/146955355', |
| 17 | + nav: [ |
| 18 | + { text: 'Guide', link: '/guide/' }, |
| 19 | + { text: 'Go', link: '/go/' }, |
| 20 | + { text: 'Rust', link: '/rust/' }, |
| 21 | + { |
| 22 | + text: 'Tools', |
| 23 | + items: [ |
| 24 | + { text: 'CLI', link: '/cli/' }, |
| 25 | + { text: 'Protobuf', link: '/protobuf/' }, |
| 26 | + ] |
| 27 | + }, |
| 28 | + { text: 'Contribute', link: '/contribute/' } |
| 29 | + ], |
| 30 | + sidebar: { |
| 31 | + '/guide/': [ |
| 32 | + { text: 'What is Mikros', link: '/guide/' }, |
| 33 | + { text: 'Service definitions', link: '/guide/service-toml' }, |
| 34 | + { text: 'Lifecycle', link: '/guide/lifecycle' }, |
| 35 | + { text: 'Extending', link: '/guide/extending' }, |
| 36 | + ], |
| 37 | + '/go/': [ |
| 38 | + { text: 'Quickstart', link: '/go/quickstart' }, |
| 39 | + { text: 'Overview', link: '/go/overview' }, |
| 40 | + { text: 'Features', link: '/go/features' }, |
| 41 | + { text: 'New service type', link: '/go/new-service-type' }, |
| 42 | + { text: 'Testing', link: '/go/testing' }, |
| 43 | + { text: 'Examples', link: '/go/examples' }, |
| 44 | + { text: 'Roadmap', link: '/go/roadmap' }, |
| 45 | + { text: 'Reference (pkg.go.dev)', link: 'https://pkg.go.dev/github.com/mikros-dev/mikros' }, |
| 46 | + ], |
| 47 | + '/rust/': [ |
| 48 | + { text: 'Quickstart', link: '/rust/quickstart' }, |
| 49 | + { text: 'Overview', link: '/rust/overview' }, |
| 50 | + { text: 'Features', link: '/rust/features' }, |
| 51 | + { text: 'New service type', link: '/rust/new-service-type' }, |
| 52 | + { text: 'Macros', link: '/rust/macros' }, |
| 53 | + { text: 'Examples', link: '/rust/examples' }, |
| 54 | + { text: 'Roadmap', link: '/rust/roadmap' }, |
| 55 | + { text: 'Reference (docs.rs)', link: 'https://docs.rs/mikros' }, |
| 56 | + ], |
| 57 | + '/protobuf/': [ |
| 58 | + { text: 'Extensions', link: '/protobuf/extensions' }, |
| 59 | + { text: 'OpenAPI', link: '/protobuf/openapi' }, |
| 60 | + ], |
| 61 | + '/contribute/': [ |
| 62 | + { text: 'How to contribute', link: '/contribute/' }, |
| 63 | + ] |
| 64 | + }, |
23 | 65 | socialLinks: [ |
24 | 66 | { icon: 'github', link: 'https://github.com/mikros-dev' }, |
25 | 67 | ], |
26 | | - } |
27 | | -} |
28 | | - |
29 | | -const rootLocale = 'en' |
30 | | -const supportedLocales = [rootLocale, 'pt']; |
31 | | -const commonSidebarConfigs: VitePressSidebarOptions = { |
32 | | - capitalizeFirst: true, |
33 | | - capitalizeEachWords: true, |
34 | | - underscoreToSpace: true, |
35 | | -} |
36 | | - |
37 | | -const vitePressSidebarConfig: VitePressSidebarOptions[] = |
38 | | - supportedLocales.map((lang) => { |
39 | | - return { |
40 | | - ...commonSidebarConfigs, |
41 | | - ...(rootLocale === lang ? {} : { basePath: `/${lang}/` }), |
42 | | - documentRootPath: `src/${lang}`, |
43 | | - resolvePath: rootLocale === lang ? '/' : `/${lang}/`, |
44 | | - }; |
45 | | - }) |
46 | | - |
47 | | -const vitePressI18nConfig: VitePressI18nOptions = { |
48 | | - locales: supportedLocales, |
49 | | - rootLocale: rootLocale, |
50 | | - searchProvider: 'local', |
51 | | - themeConfig: { |
52 | | - en: { |
53 | | - nav: [ |
54 | | - { text: 'Home', link: '/' }, |
55 | | - { text: 'Getting Started', link: '/getting_started/' }, |
56 | | - { text: 'Guides', link: '/guides/service_toml' }, |
57 | | - { |
58 | | - text: 'Documentation', |
59 | | - items: [ |
60 | | - { text: 'Core Concepts', link: '/guides/concepts' }, |
61 | | - { text: 'Architecture', link: '/guides/architecture' }, |
62 | | - { text: 'Best Practices', link: '/guides/best_practices' } |
63 | | - ] |
64 | | - }, |
65 | | - { text: 'API', link: '/api/' } |
66 | | - ], |
| 68 | + editLink: { |
| 69 | + pattern: 'https://github.com/mikros-dev/mikros-docs/edit/main/src/:path', |
| 70 | + text: 'Edit this page on GitHub' |
67 | 71 | }, |
68 | | - pt: { |
69 | | - nav: [ |
70 | | - { text: 'Início', link: '/pt/' }, |
71 | | - { text: 'Primeiros Passos', link: '/pt/getting_started/' }, |
72 | | - { text: 'Guias', link: '/pt/guides/service_toml' }, |
73 | | - { |
74 | | - text: 'Documentação', |
75 | | - items: [ |
76 | | - { text: 'Conceitos Básicos', link: '/pt/guides/concepts' }, |
77 | | - { text: 'Arquitetura', link: '/pt/guides/architecture' }, |
78 | | - { text: 'Melhores Práticas', link: '/pt/guides/best_practices' } |
79 | | - ] |
80 | | - }, |
81 | | - { text: 'API', link: '/pt/api/' } |
82 | | - ], |
83 | | - } |
84 | | - } |
85 | | -}; |
86 | | - |
87 | | - |
88 | | -// https://vitepress.dev/reference/site-config |
89 | | -export default defineConfig( |
90 | | - withSidebar(withI18n(vitePressConfig, vitePressI18nConfig), vitePressSidebarConfig) |
91 | | -); |
| 72 | + footer: { |
| 73 | + message: 'Mikros is MIT/MPL-2.0 licensed', |
| 74 | + copyright: '© Mikros' |
| 75 | + }, |
| 76 | + outline: [2,3] |
| 77 | + }, |
| 78 | + head: [ |
| 79 | + ['meta', { name: 'theme-color', content: '#0b0f19' }], |
| 80 | + ['link', { rel: 'icon', href: 'favicon.svg' }] |
| 81 | + ], |
| 82 | +}) |
0 commit comments