From 38078cb1c7fc8d35fc3321925c187285aa12393f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D0=B5=D0=B3=20=D0=A9=D0=B0=D0=B2=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=B2?= Date: Thu, 1 Aug 2024 02:35:58 +0300 Subject: [PATCH] config: fix search --- .vitepress/config/plugins/index.ts | 3 ++- .../config/plugins/vitepress-search/index.ts | 21 ++++++++++++++++ .vitepress/config/ru.ts | 24 ------------------- .vitepress/config/shared.ts | 24 +++++++++++++++++++ 4 files changed, 47 insertions(+), 25 deletions(-) create mode 100644 .vitepress/config/plugins/vitepress-search/index.ts diff --git a/.vitepress/config/plugins/index.ts b/.vitepress/config/plugins/index.ts index 468eb4f..6b72405 100644 --- a/.vitepress/config/plugins/index.ts +++ b/.vitepress/config/plugins/index.ts @@ -1,4 +1,5 @@ export { NolebaseEnhancedReadabilitiesOptions } from './NolebaseEnhancedReadabilities/index' export { NolebaseGitChangelogOptions } from './NolebaseGitChangelog/index' export { VueSilentBoxOptions } from './VueSilentBox/index' -export { YandexMetrikaOptions } from './YandexMetrica/index' \ No newline at end of file +export { YandexMetrikaOptions } from './YandexMetrica/index' +export { vpSearchOptions } from './vitepress-search' \ No newline at end of file diff --git a/.vitepress/config/plugins/vitepress-search/index.ts b/.vitepress/config/plugins/vitepress-search/index.ts new file mode 100644 index 0000000..3febe2d --- /dev/null +++ b/.vitepress/config/plugins/vitepress-search/index.ts @@ -0,0 +1,21 @@ +export const vpSearchOptions = { + locales: { + root: { + translations: { + button: { + buttonText: 'Поиск', + buttonAriaLabel: 'Поиск' + }, + modal: { + noResultsText: 'Нет результатов по запросу', + resetButtonTitle: 'Сбросить', + footer: { + selectText: 'для выбора', + navigateText: 'для навигации', + closeText: 'закрыть' + } + } + } + } + } + } \ No newline at end of file diff --git a/.vitepress/config/ru.ts b/.vitepress/config/ru.ts index 58d2385..c3d04d8 100644 --- a/.vitepress/config/ru.ts +++ b/.vitepress/config/ru.ts @@ -14,30 +14,6 @@ export const ru = defineConfigWithTheme({ themeConfig: { nav: nav, sidebar: sidebar, - search: { - provider: 'local', - options: { - locales: { - root: { - translations: { - button: { - buttonText: 'Поиск', - buttonAriaLabel: 'Поиск' - }, - modal: { - noResultsText: 'Нет результатов по запросу', - resetButtonTitle: 'Сбросить', - footer: { - selectText: 'для выбора', - navigateText: 'для навигации', - closeText: 'закрыть' - } - } - } - } - } - } - }, editLink: { pattern: 'https://github.com/OlegShchavelev/ALTRegularKDEWiki/edit/main/docs/:path', text: 'Предложить изменения на этой странице' diff --git a/.vitepress/config/shared.ts b/.vitepress/config/shared.ts index ed60bad..69fbedf 100644 --- a/.vitepress/config/shared.ts +++ b/.vitepress/config/shared.ts @@ -59,6 +59,30 @@ export const shared = defineConfig({ }, themeConfig: { logo: { src: '/logo.png', width: 36, height: 36, alt: "ALT KDE Wiki" }, + search: { + provider: 'local', + options: { + locales: { + root: { + translations: { + button: { + buttonText: 'Поиск', + buttonAriaLabel: 'Поиск' + }, + modal: { + noResultsText: 'Нет результатов по запросу', + resetButtonTitle: 'Сбросить', + footer: { + selectText: 'для выбора', + navigateText: 'для навигации', + closeText: 'закрыть' + } + } + } + } + } + } + }, socialLinks: [ { icon: {