Skip to content

Commit 40ec616

Browse files
Initialize documentation project with VitePress configuration
- Set up VitePress configuration with multilingual support (English and Portuguese) - Add GitHub Actions workflow for deploying to GitHub Pages - Create initial documentation structure with landing pages and getting started guides - Configure sidebar and navigation for both languages - Add basic service configuration, plugins, testing, and tracing documentation - Include favicon and package management files
0 parents  commit 40ec616

File tree

22 files changed

+5207
-0
lines changed

22 files changed

+5207
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Sample workflow for building and deploying a VitePress site to GitHub Pages
2+
#
3+
name: Deploy VitePress site to Pages
4+
5+
on:
6+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
7+
# using the `master` branch as the default branch.
8+
push:
9+
branches: [main]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22+
concurrency:
23+
group: pages
24+
cancel-in-progress: false
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
35+
# - uses: pnpm/action-setup@v3 # Uncomment this block if you're using pnpm
36+
# with:
37+
# version: 9 # Not needed if you've set "packageManager" in package.json
38+
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
39+
- name: Setup Node
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: 20
43+
cache: npm # or pnpm / yarn
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v4
46+
- name: Install dependencies
47+
run: npm ci # or pnpm install / yarn install / bun install
48+
- name: Build with VitePress
49+
run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
50+
- name: Upload artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: docs/.vitepress/dist
54+
55+
# Deployment job
56+
deploy:
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
needs: build
61+
runs-on: ubuntu-latest
62+
name: Deploy
63+
steps:
64+
- name: Deploy to GitHub Pages
65+
id: deployment
66+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
3+
node_modules
4+
.vitepress/cache
5+
6+
.DS_Store

.vitepress/config.mts

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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';
6+
7+
// Base VitePress configuration
8+
const vitePressConfig: UserConfig = {
9+
title: 'Mikros',
10+
description: 'Mikros docs',
11+
srcDir: './src',
12+
assetsDir: './public',
13+
rewrites: {
14+
'en/:rest*': ':rest*'
15+
},
16+
head: [
17+
['link', { rel: 'icon', href: '/favicon.ico' }]
18+
],
19+
// Configure locales
20+
locales: {
21+
root: {
22+
label: 'English',
23+
lang: 'en',
24+
link: '/',
25+
themeConfig: {
26+
nav: [
27+
{ text: 'Home', link: '/' },
28+
{ text: 'Getting Started', link: '/getting_started/' },
29+
{ text: 'Guides', link: '/guides/service_toml' },
30+
{
31+
text: 'Documentation',
32+
items: [
33+
{ text: 'Core Concepts', link: '/guides/concepts' },
34+
{ text: 'Architecture', link: '/guides/architecture' },
35+
{ text: 'Best Practices', link: '/guides/best_practices' }
36+
]
37+
},
38+
{ text: 'API', link: '/api/' }
39+
]
40+
}
41+
},
42+
pt: {
43+
label: 'Português',
44+
lang: 'pt',
45+
link: '/pt/',
46+
themeConfig: {
47+
nav: [
48+
{ text: 'Início', link: '/pt/' },
49+
{ text: 'Primeiros Passos', link: '/pt/getting_started/' },
50+
{ text: 'Guias', link: '/pt/guides/service_toml' },
51+
{
52+
text: 'Documentação',
53+
items: [
54+
{ text: 'Conceitos Básicos', link: '/pt/guides/concepts' },
55+
{ text: 'Arquitetura', link: '/pt/guides/architecture' },
56+
{ text: 'Melhores Práticas', link: '/pt/guides/best_practices' }
57+
]
58+
},
59+
{ text: 'API', link: '/pt/api/' }
60+
]
61+
}
62+
}
63+
},
64+
65+
themeConfig: {
66+
// Common theme config
67+
socialLinks: [
68+
{ icon: 'github', link: 'https://github.com/mikros-dev' },
69+
]
70+
}
71+
}
72+
73+
const rootLocale = 'en'
74+
const supportedLocales = [rootLocale, 'pt'];
75+
76+
77+
const commonSidebarConfigs: VitePressSidebarOptions = {
78+
capitalizeFirst: true,
79+
capitalizeEachWords: true,
80+
underscoreToSpace: true,
81+
}
82+
83+
const vitePressSidebarConfig: VitePressSidebarOptions[] =
84+
supportedLocales.map((lang) => {
85+
return {
86+
...commonSidebarConfigs,
87+
...(rootLocale === lang ? {} : { basePath: `/${lang}/` }),
88+
documentRootPath: `src/${lang}`,
89+
resolvePath: rootLocale === lang ? '/' : `/${lang}/`,
90+
};
91+
})
92+
93+
94+
95+
const vitePressI18nConfig: VitePressI18nOptions = {
96+
locales: [
97+
{ path: '/', locale: 'en' }, // Empty path for the root locale
98+
{ path: 'pt', locale: 'pt' }
99+
],
100+
rootLocale: 'en',
101+
};
102+
103+
104+
// https://vitepress.dev/reference/site-config
105+
export default defineConfig(
106+
withSidebar(withI18n(vitePressConfig, vitePressI18nConfig), vitePressSidebarConfig)
107+
);

0 commit comments

Comments
 (0)