- Переработан раздел Workflow: заголовки, описания, порядок разделов - Добавлены новые разделы: Генерация кода (workflow), Настройка VS Code (applied) - Убран суффикс .ui.tsx из документации и примеров - Переработан раздел Структура проекта — только Next.js, без React SPA - Приоритет стилизации перенесён из applied/styles в workflow/styling - Убрано дублирование инструментов генерации — единая точка в applied/templates-generation - Переписан concat-md.js: без внешних зависимостей, мета-якоря для навигации в RULES.md - Удалена зависимость concat-md - Обновлена главная страница: названия разделов, URL на RULES.md - Добавлен AGENTS.md с правилами для агентов
123 lines
4.8 KiB
TypeScript
123 lines
4.8 KiB
TypeScript
import { defineConfig } from 'vitepress';
|
|
|
|
const ruSidebar = [
|
|
{
|
|
text: 'Workflow',
|
|
items: [
|
|
{ text: 'Начало работы', link: '/workflow/getting-started' },
|
|
{ text: 'Создание проекта', link: '/workflow/creating-app' },
|
|
{ text: 'Генерация кода', link: '/workflow/code-generation' },
|
|
{ text: 'Добавление страницы', link: '/workflow/creating-pages' },
|
|
{ text: 'Добавление UI-модуля', link: '/workflow/creating-components' },
|
|
{ text: 'Стилизация', link: '/workflow/styling' },
|
|
{ text: 'Получение данных', link: '/workflow/data-fetching' },
|
|
{ text: 'Управление состоянием', link: '/workflow/state-management' },
|
|
{ text: 'Локализация', link: '/workflow/localization' },
|
|
],
|
|
},
|
|
{
|
|
text: 'Базовые правила',
|
|
items: [
|
|
{ text: 'Технологии и библиотеки', link: '/basics/tech-stack' },
|
|
{ text: 'Архитектура', link: '/basics/architecture' },
|
|
{ text: 'Стиль кода', link: '/basics/code-style' },
|
|
{ text: 'Именование', link: '/basics/naming' },
|
|
{ text: 'Документирование', link: '/basics/documentation' },
|
|
{ text: 'Типизация', link: '/basics/typing' },
|
|
],
|
|
},
|
|
{
|
|
text: 'Прикладные разделы',
|
|
items: [
|
|
{ text: 'Настройка VS Code', link: '/applied/vscode' },
|
|
{ text: 'Структура проекта', link: '/applied/project-structure' },
|
|
{ text: 'Компоненты', link: '/applied/components' },
|
|
{ text: 'Page-level компоненты', link: '/applied/page-level' },
|
|
{ text: 'Шаблоны и генерация кода', link: '/applied/templates-generation' },
|
|
{ text: 'Стили', link: '/applied/styles' },
|
|
{ text: 'Изображения', link: '/applied/images-sprites' },
|
|
{ text: 'SVG-спрайты', link: '/applied/svg-sprites' },
|
|
{ text: 'Видео', link: '/applied/video' },
|
|
{ text: 'API', link: '/applied/api' },
|
|
{ text: 'Stores', link: '/applied/stores' },
|
|
{ text: 'Хуки', link: '/applied/hooks' },
|
|
{ text: 'Шрифты', link: '/applied/fonts' },
|
|
{ text: 'Локализация', link: '/applied/localization' },
|
|
],
|
|
},
|
|
];
|
|
|
|
const enSidebar = [
|
|
{
|
|
text: 'Processes',
|
|
items: [
|
|
{ text: 'Getting Started', link: '/en/workflow/getting-started' },
|
|
{ text: 'Creating an App', link: '/en/workflow/creating-app' },
|
|
{ text: 'Creating Pages', link: '/en/workflow/creating-pages' },
|
|
{ text: 'Creating Components', link: '/en/workflow/creating-components' },
|
|
{ text: 'Styling', link: '/en/workflow/styling' },
|
|
{ text: 'Data Fetching', link: '/en/workflow/data-fetching' },
|
|
{ text: 'State Management', link: '/en/workflow/state-management' },
|
|
{ text: 'Localization', link: '/en/workflow/localization' },
|
|
],
|
|
},
|
|
{
|
|
text: 'Basic Rules',
|
|
items: [
|
|
{ text: 'Tech Stack', link: '/en/basics/tech-stack' },
|
|
{ text: 'Architecture', link: '/en/basics/architecture' },
|
|
{ text: 'Code Style', link: '/en/basics/code-style' },
|
|
{ text: 'Naming', link: '/en/basics/naming' },
|
|
{ text: 'Documentation', link: '/en/basics/documentation' },
|
|
{ text: 'Typing', link: '/en/basics/typing' },
|
|
],
|
|
},
|
|
{
|
|
text: 'Applied Sections',
|
|
items: [
|
|
{ text: 'VS Code Setup', link: '/en/applied/vscode' },
|
|
{ text: 'Project Structure', link: '/en/applied/project-structure' },
|
|
{ text: 'Components', link: '/en/applied/components' },
|
|
{ text: 'Page-level Components', link: '/en/applied/page-level' },
|
|
{ text: 'Templates & Code Generation', link: '/en/applied/templates-generation' },
|
|
{ text: 'Styles', link: '/en/applied/styles' },
|
|
{ text: 'Images', link: '/en/applied/images-sprites' },
|
|
{ text: 'SVG Sprites', link: '/en/applied/svg-sprites' },
|
|
{ text: 'Video', link: '/en/applied/video' },
|
|
{ text: 'API', link: '/en/applied/api' },
|
|
{ text: 'Stores', link: '/en/applied/stores' },
|
|
{ text: 'Hooks', link: '/en/applied/hooks' },
|
|
{ text: 'Fonts', link: '/en/applied/fonts' },
|
|
{ text: 'Localization', link: '/en/applied/localization' },
|
|
],
|
|
},
|
|
];
|
|
|
|
export default defineConfig({
|
|
srcDir: 'docs',
|
|
title: 'NextJS Style Guide',
|
|
description: 'Правила и стандарты разработки на NextJS и TypeScript',
|
|
|
|
rewrites: {
|
|
'ru/:rest*': ':rest*',
|
|
},
|
|
|
|
locales: {
|
|
root: {
|
|
label: 'Русский',
|
|
lang: 'ru-RU',
|
|
themeConfig: {
|
|
sidebar: ruSidebar,
|
|
},
|
|
},
|
|
en: {
|
|
label: 'English',
|
|
lang: 'en-US',
|
|
link: '/en/',
|
|
themeConfig: {
|
|
sidebar: enSidebar,
|
|
},
|
|
},
|
|
},
|
|
});
|