sync
Some checks failed
CI/CD Pipeline / deploy (push) Blocked by required conditions
CI/CD Pipeline / docker (push) Failing after 12m36s

This commit is contained in:
2026-03-28 21:15:15 +03:00
parent a9f91dae29
commit b37eb75542
67 changed files with 1203 additions and 152 deletions

View File

@@ -1,55 +1,117 @@
import { defineConfig } from 'vitepress';
const versions = Array.from({ length: 100 }, (_, i) => {
const major = Math.floor(i / 10) + 1;
const minor = i % 10;
return `v${major}.${minor}`;
}).reverse();
export default defineConfig({
lang: 'ru-RU',
title: 'Frontend Style Guide',
description: 'Правила и стандарты разработки фронтенд-проектов на React/NextJS и TypeScript',
themeConfig: {
siteTitle: 'Frontend Style Guide',
nav: [
{
text: versions[0],
items: versions.map((v) => ({
text: v,
link: `/${v}/`,
})),
},
],
sidebar: [
{
text: 'Базовые правила',
items: [
{ text: 'Технологии и библиотеки', link: '/parts/1-tech-stack' },
{ text: 'Архитектура', link: '/parts/2-architecture' },
{ text: 'Стиль кода', link: '/parts/3-code-style' },
{ text: 'Именование', link: '/parts/4-naming' },
{ text: 'Документирование', link: '/parts/5-documentation' },
{ text: 'Типизация', link: '/parts/6-typing' },
],
},
{
text: 'Прикладные разделы',
items: [
{ text: 'Структура проекта', link: '/parts/7-project-structure' },
{ text: 'Компоненты', link: '/parts/8-0-components' },
{ text: 'Шаблоны и генерация кода', link: '/parts/8-1-templates-generation' },
{ text: 'Стили', link: '/parts/9-styles' },
{ text: 'Изображения', link: '/parts/10-images-sprites' },
{ text: 'SVG-спрайты', link: '/parts/17-svg-sprites' },
{ text: 'Видео', link: '/parts/11-video' },
{ text: 'API', link: '/parts/12-api' },
{ text: 'Stores', link: '/parts/13-stores' },
{ text: 'Хуки', link: '/parts/14-hooks' },
{ text: 'Шрифты', link: '/parts/15-fonts' },
{ text: 'Локализация', link: '/parts/16-localization' },
],
},
const ruSidebar = [
{
text: 'Workflow',
items: [
{ text: 'Начало работы', link: '/workflow/getting-started' },
{ text: 'Создание приложения', link: '/workflow/creating-app' },
{ text: 'Создание страниц', link: '/workflow/creating-pages' },
{ text: 'Создание компонентов', 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: 'Структура проекта', link: '/applied/project-structure' },
{ text: 'Компоненты', link: '/applied/components' },
{ 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: 'Project Structure', link: '/en/applied/project-structure' },
{ text: 'Components', link: '/en/applied/components' },
{ 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,
},
},
},
});