09.01 — Stack VitePress + Sugar Theme + plugins maison#
package.json#
{
"dependencies": {
"@sugarat/theme": "0.5.17"
},
"devDependencies": {
"@commitlint/config-conventional": "20.5.0",
"@commitlint/cz-commitlint": "20.5.1",
"@eslint/js": "10.0.1",
"@types/node": "25.6.0",
"commitizen": "4.3.1",
"editorconfig": "3.0.2",
"eslint": "10.2.1",
"eslint-plugin-import-x": "4.16.2",
"eslint-plugin-perfectionist": "5.9.0",
"eslint-plugin-unused-imports": "4.4.1",
"globals": "17.5.0",
"husky": "9.1.7",
"inquirer": "9.0.0",
"is-ci": "4.1.0",
"lint-staged": "16.4.0",
"pagefind": "1.5.2",
"prettier": "3.8.3",
"sass-embedded": "1.99.0",
"typescript": "6.0.3",
"typescript-eslint": "8.59.0",
"vitepress": "2.0.0-alpha.17",
"vitepress-plugin-image-optimize": "1.5.1",
"vue": "3.5.33"
},
"engines": {
"node": "^24.x",
"pnpm": "11.x"
}
}| Lib | Rôle |
|---|---|
vitepress 2.0.0-alpha.17 | SSG framework, basé sur Vite |
@sugarat/theme | Theme blog tier-1 (templates, sidebar auto, cover images) |
vue 3.5.33 | Requis par VitePress |
vitepress-plugin-image-optimize | Optimisation des images au build |
pagefind 1.5.2 | Moteur de recherche statique (full-text, side-CDN) |
sass-embedded | Compile SCSS (utilisé par @sugarat/theme) |
| Husky / lint-staged / commitlint | Mêmes outils que les autres dépôts (Conventional Commits) |
docs/.vitepress/config.mts#
import { defineConfig } from 'vitepress';
import path from 'path';
import fs from 'fs';
import { generateSkills } from './plugins/skills';
import { generateLlms } from './plugins/llm';
import { generatePub } from './plugins/pub';
import { blogTheme } from './blog-theme';
import webpConfig from './plugins/webp';
const base = process.env.GITHUB_ACTIONS === 'true' ? '/ocarina-holy-book/' : '/';
export default defineConfig({
locales: {
root: {
themeConfig: {
outline: { label: 'Table of content' },
skipToContentLabel: 'Skip to content',
sidebarMenuLabel: 'Related articles',
returnToTopLabel: 'Return to top',
lastUpdatedText: 'Last update:'
},
description: "Ocarina is Igor's automated web browser testing framework.",
title: 'The Ocarina Holy Book',
label: 'English',
lang: 'en'
},
fr: {
themeConfig: {
outline: { label: 'Sommaire', level: [2, 3] },
returnToTopLabel: 'Retour en haut de page',
lastUpdatedText: 'Dernière mise à jour :',
skipToContentLabel: 'Passer au contenu',
sidebarMenuLabel: 'Voir aussi'
},
title: "Le livre sacré d'Ocarina",
label: 'Français',
lang: 'fr'
}
ru: {
themeConfig: {
outline: {
label: 'Оглавление',
level: [2, 3]
},
skipToContentLabel: 'Перейти к содержанию',
lastUpdatedText: 'Последнее обновление:',
returnToTopLabel: 'Вернуться вверх',
sidebarMenuLabel: 'Смотрите также'
},
title: 'Священная Книга Ocarina',
label: 'Русский',
lang: 'ru'
}
},
vite: { ... },
...
});1. base#
const base =
process.env.GITHUB_ACTIONS === "true" ? "/ocarina-holy-book/" : "/";→ En CI (GitHub Actions) : base = /ocarina-holy-book/ (préfixe GitHub Pages).
→ En local : / (sert depuis la racine du dev server).