From 6d4d8203f7d1b85f8b35f328dc5e979e13bb272b Mon Sep 17 00:00:00 2001 From: Bugo Date: Fri, 22 Mar 2024 12:20:33 +0500 Subject: [PATCH] Add config/ru.ts --- docs/.vitepress/config/ru.ts | 205 +++++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 docs/.vitepress/config/ru.ts diff --git a/docs/.vitepress/config/ru.ts b/docs/.vitepress/config/ru.ts new file mode 100644 index 00000000..db84f9b4 --- /dev/null +++ b/docs/.vitepress/config/ru.ts @@ -0,0 +1,205 @@ +import { createRequire } from 'module' +import { defineConfig, type DefaultTheme } from 'vitepress' + +const require = createRequire(import.meta.url) +const pkg = require('vitepress/package.json') + +export const ru = defineConfig({ + lang: 'ru-RU', + description: 'Генератор статических сайтов на основе Vite и Vue.', + + themeConfig: { + nav: nav(), + + sidebar: { + '/ru/guide/': { base: '/ru/guide/', items: sidebarGuide() }, + '/ru/reference/': { base: '/ru/reference/', items: sidebarReference() } + }, + + editLink: { + pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path', + text: 'Редактировать эту страницу на GitHub' + }, + + footer: { + message: 'Опубликовано под лицензией MIT.', + copyright: '© 2019 – настоящее время, Эван Ю' + }, + + outline: { label: 'Содержание страницы' }, + + docFooter: { + prev: 'Предыдущая страница', + next: 'Следующая страница' + }, + + lastUpdated: { + text: 'Обновлено' + }, + + darkModeSwitchLabel: 'Оформление', + lightModeSwitchTitle: 'Переключить на светлую тему', + darkModeSwitchTitle: 'Переключить на тёмную тему', + sidebarMenuLabel: 'Меню', + returnToTopLabel: 'Вернуться к началу', + langMenuLabel: 'Изменить язык' + } +}) + +function nav(): DefaultTheme.NavItem[] { + return [ + { + text: 'Руководство', + link: '/ru/guide/what-is-vitepress', + activeMatch: '/ru/guide/' + }, + { + text: 'Справочник', + link: '/ru/reference/site-config', + activeMatch: '/ru/reference/' + }, + { + text: pkg.version, + items: [ + { + text: 'Изменения', + link: 'https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md' + }, + { + text: 'Вклад', + link: 'https://github.com/vuejs/vitepress/blob/main/.github/contributing.md' + } + ] + } + ] +} + +function sidebarGuide(): DefaultTheme.SidebarItem[] { + return [ + { + text: 'Введение', + collapsed: false, + items: [ + { text: 'Что за VitePress?', link: 'what-is-vitepress' }, + { text: 'Первые шаги', link: 'getting-started' }, + { text: 'Маршрутизация', link: 'routing' }, + { text: 'Развёртывание', link: 'deploy' } + ] + }, + { + text: 'Написание', + collapsed: false, + items: [ + { text: 'Расширения Markdown', link: 'markdown' }, + { text: 'Обработка ресурсов', link: 'asset-handling' }, + { text: 'Метаданные', link: 'frontmatter' }, + { text: 'Использование Vue в Markdown', link: 'using-vue' }, + { text: 'Интернационализация', link: 'i18n' } + ] + }, + { + text: 'Настройка', + collapsed: false, + items: [ + { text: 'Использование пользовательской темы', link: 'custom-theme' }, + { + text: 'Расширение темы по умолчанию', + link: 'extending-default-theme' + }, + { + text: 'Загрузка данных в режиме реального времени', + link: 'data-loading' + }, + { text: 'Совместимость с SSR', link: 'ssr-compat' }, + { text: 'Подключение к CMS', link: 'cms' } + ] + }, + { + text: 'Экспериментально', + collapsed: false, + items: [ + { text: 'Режим MPA', link: 'mpa-mode' }, + { text: 'Генерация карты сайта', link: 'sitemap-generation' } + ] + }, + { text: 'Настройка и API', base: '/ru/reference/', link: 'site-config' } + ] +} + +function sidebarReference(): DefaultTheme.SidebarItem[] { + return [ + { + text: 'Справочник', + items: [ + { text: 'Настройка сайта', link: 'site-config' }, + { text: 'Настройка метаданных', link: 'frontmatter-config' }, + { text: 'Runtime API', link: 'runtime-api' }, + { text: 'Командная строка', link: 'cli' }, + { + text: 'Тема по умолчанию', + base: '/ru/reference/default-theme-', + items: [ + { text: 'Обзор', link: 'config' }, + { text: 'Навигация', link: 'nav' }, + { text: 'Сайдбар', link: 'sidebar' }, + { text: 'Главная страница', link: 'home-page' }, + { text: 'Подвал', link: 'footer' }, + { text: 'Макет', link: 'layout' }, + { text: 'Бейджик', link: 'badge' }, + { text: 'Страница команды', link: 'team-page' }, + { text: 'Ссылка предыдущая / следующая', link: 'prev-next-links' }, + { text: 'Ссылка для редактирования', link: 'edit-link' }, + { text: 'Время последнего обновления', link: 'last-updated' }, + { text: 'Поиск', link: 'search' }, + { text: 'Carbon Ads (реклама)', link: 'carbon-ads' } + ] + } + ] + } + ] +} + +export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = { + ru: { + placeholder: 'Поиск в документации', + translations: { + button: { + buttonText: 'Поиск', + buttonAriaLabel: 'Поиск' + }, + modal: { + searchBox: { + resetButtonTitle: 'Сбросить поиск', + resetButtonAriaLabel: 'Сбросить поиск', + cancelButtonText: 'Отменить поиск', + cancelButtonAriaLabel: 'Отменить поиск' + }, + startScreen: { + recentSearchesTitle: 'История поиска', + noRecentSearchesText: 'Нет истории поиска', + saveRecentSearchButtonTitle: 'Сохранить в истории поиска', + removeRecentSearchButtonTitle: 'Удалить из истории поиска', + favoriteSearchesTitle: 'Избранное', + removeFavoriteSearchButtonTitle: 'Удалить из избранного' + }, + errorScreen: { + titleText: 'Невозможно получить результаты', + helpText: 'Вам может потребоваться проверить подключение к Интернету' + }, + footer: { + selectText: 'выбрать', + navigateText: 'перейти', + closeText: 'закрыть', + searchByText: 'поставщик поиска' + }, + noResultsScreen: { + noResultsText: 'Нет результатов для', + suggestedQueryText: 'Вы можете попытаться узнать', + reportMissingResultsText: + 'Считаете, что поиск даёт ложные результаты?', + reportMissingResultsLinkText: 'Нажмите на кнопку «Обратная связь»' + } + } + } + } +}