From 108d24a1c89997182fc238fab56e932f2c1e4a94 Mon Sep 17 00:00:00 2001 From: Zakhar Timoshenko Date: Fri, 13 Oct 2023 01:53:00 +0300 Subject: [PATCH] Some fixes and translations --- .vitepress/config/en.ts | 11 +- .vitepress/config/hooks/generateMeta.ts | 2 +- .vitepress/config/index.ts | 17 +-- .vitepress/config/ru.ts | 3 - .vitepress/config/shortcodes.ts | 7 ++ .vitepress/config/ua.ts | 4 +- .vitepress/theme/components/Breadcrumbs.vue | 2 +- .vitepress/theme/components/Layout.vue | 4 +- ...rWidget.vue => ScreenTranslatorWidget.vue} | 13 +-- .../theme/components/TranslatorWidget.vue | 6 +- .vitepress/theme/composables/langs.ts | 10 +- .vitepress/theme/composables/prev-next.ts | 8 +- .../plugins/{component.ts => section.ts} | 46 +++++--- .vitepress/theme/styles/global.css | 4 + .vitepress/theme/types/index.ts | 8 +- .vitepress/theme/utils.ts | 10 +- website/manuals/faq/explore/sources.md | 2 +- .../guides/troubleshooting/diagnosis.md | 2 +- website/ua/contribute/index.md | 1 - website/ua/manuals/faq/explore/downloads.md | 2 +- website/ua/manuals/faq/explore/index.md | 4 +- .../ua/manuals/faq/explore/local-storage.md | 4 +- website/ua/manuals/faq/explore/random.md | 4 +- website/ua/manuals/faq/explore/sources.md | 50 ++++----- website/ua/manuals/faq/explore/suggestions.md | 4 +- website/ua/manuals/faq/feed.md | 17 ++- website/ua/manuals/faq/general.md | 39 +++---- website/ua/manuals/faq/reader.md | 23 ++-- website/ua/manuals/faq/settings.md | 18 ++-- .../guides/troubleshooting/common-issues.md | 83 +++++++------- .../guides/troubleshooting/diagnosis.md | 101 +++++++++--------- 31 files changed, 261 insertions(+), 248 deletions(-) rename .vitepress/theme/components/{ScreenAuthorWidget.vue => ScreenTranslatorWidget.vue} (79%) rename .vitepress/theme/plugins/{component.ts => section.ts} (67%) diff --git a/.vitepress/config/en.ts b/.vitepress/config/en.ts index e3da69c..9375a97 100644 --- a/.vitepress/config/en.ts +++ b/.vitepress/config/en.ts @@ -1,6 +1,5 @@ import type { DefaultTheme, LocaleConfig } from 'vitepress' import type { Theme } from '../theme/types' -import { components } from '../theme/plugins/component' import 'dotenv/config' export const SITE_NAME = 'Kotatsu Website' @@ -65,8 +64,6 @@ export const config: LocaleConfig = { message: "GPL-3.0 Licensed | Privacy policy", copyright: `Copyright © 2020 - ${new Date().getFullYear()} Kotatsu Developers`, }, - - components: components.filter(component => component.path.startsWith('components/')), }, } } @@ -80,10 +77,10 @@ function defaultSidebar(): DefaultTheme.SidebarItem[] { text: "Download", link: "/download/", }, - { + /* { text: "Parsers", link: "/parsers/", - }, + }, */ { text: "Changelogs", link: "/changelogs/", @@ -209,7 +206,7 @@ function getNav(): DefaultTheme.NavItem[] { link: "/manuals/guides/getting-started", activeMatch: "/manuals/", }, - { + /* { text: "News", link: "/news/", activeMatch: "/news/", @@ -218,6 +215,6 @@ function getNav(): DefaultTheme.NavItem[] { text: "Account", link: "/account/", activeMatch: "/account/" - } + } */ ] } \ No newline at end of file diff --git a/.vitepress/config/hooks/generateMeta.ts b/.vitepress/config/hooks/generateMeta.ts index 6cecaed..89a2bee 100644 --- a/.vitepress/config/hooks/generateMeta.ts +++ b/.vitepress/config/hooks/generateMeta.ts @@ -1,5 +1,5 @@ import type { HeadConfig, TransformContext } from "vitepress" -import type { DocsPageData } from '../../theme/plugins/component' +import type { DocsPageData } from '../../theme/plugins/section' function generateMeta(context: TransformContext, hostname: string) { const head: HeadConfig[] = [] diff --git a/.vitepress/config/index.ts b/.vitepress/config/index.ts index d3ba884..d9dd45f 100644 --- a/.vitepress/config/index.ts +++ b/.vitepress/config/index.ts @@ -1,15 +1,13 @@ import type { Theme } from '../theme/types' -import type { DocsPageData } from '../theme/plugins/component' -import { type HeadConfig, defineConfigWithTheme } from 'vitepress' +import { defineConfigWithTheme } from 'vitepress' import { config as ru, searchLocale as searchLocaleRu } from './ru' import { config as root, searchLocale as searchLocaleEn } from './en' import { config as ua, searchLocale as searchLocaleUa } from './ua' import { addPlugins } from '../theme/plugins/markdown' -import { components, prepareData } from '../theme/plugins/component' +import { sections, prepareData } from '../theme/plugins/section' import { slugify } from 'transliteration' import { fileURLToPath, URL } from 'node:url' import { telegram } from '../../website/icons' -import { normalize } from 'vitepress/dist/client/shared' import { tabsMarkdownPlugin } from "vitepress-plugin-tabs" import pluginRewriteAll from 'vite-plugin-rewrite-all'; @@ -63,7 +61,7 @@ export default defineConfigWithTheme({ ['link', { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap' }], ['link', { rel: 'icon', href: '/favicon.ico?v=2', sizes: 'any' }], - ['link', { rel: 'icon', href: '/icon.svg?v=2', type: 'image/svg+xml' }], + ['link', { rel: 'icon', href: '/logo.svg?v=2', type: 'image/svg+xml' }], ['link', { rel: 'apple-touch-icon', href: '/apple-touch-icon.png?v=2' }], ['link', { rel: 'manifest', href: '/site.webmanifest' }], ], @@ -87,9 +85,16 @@ export default defineConfigWithTheme({ search: { provider: 'local', + options: { + locales: { + ...searchLocaleEn, + ...searchLocaleRu, + ...searchLocaleUa, + }, + }, }, - components, + sections, }, locales: { diff --git a/.vitepress/config/ru.ts b/.vitepress/config/ru.ts index 6f43eb7..758aec0 100644 --- a/.vitepress/config/ru.ts +++ b/.vitepress/config/ru.ts @@ -1,6 +1,5 @@ import type { DefaultTheme, LocaleConfig } from 'vitepress' import type { Theme } from '../theme/types' -import { components } from '../theme/plugins/component' import 'dotenv/config' export const SITE_NAME = 'Kotatsu Website' @@ -75,8 +74,6 @@ export const config: LocaleConfig = { message: "Лицензия GPL-3.0 | Политика конфиденциальности", copyright: `Copyright © 2020 - ${new Date().getFullYear()} Kotatsu Developers`, }, - - components: components.filter(component => component.path.startsWith('ru/components/')), }, } } diff --git a/.vitepress/config/shortcodes.ts b/.vitepress/config/shortcodes.ts index ca79d3b..83f50cd 100644 --- a/.vitepress/config/shortcodes.ts +++ b/.vitepress/config/shortcodes.ts @@ -1,3 +1,10 @@ +import { type Ref, computed } from 'vue' +import { type PageData, useData } from 'vitepress' + +export interface Data { + lang: Ref +} + const iconMappings = { about: 'information-outline', bookmark: 'bookmark-outline', diff --git a/.vitepress/config/ua.ts b/.vitepress/config/ua.ts index 784c838..a2182a5 100644 --- a/.vitepress/config/ua.ts +++ b/.vitepress/config/ua.ts @@ -1,6 +1,6 @@ import type { DefaultTheme, LocaleConfig } from 'vitepress' import type { Theme } from '../theme/types' -import { components } from '../theme/plugins/component' +import { sections } from '../theme/plugins/section' export const SITE_NAME = 'Kotatsu Website' export const META_DESCRIPTION = 'Проста і зручна читалка манги з відкритим вихідним кодом від спільноти і для спільноти, де ви можете знайти і читати вашу улюблену мангу простіше як ніколи.' @@ -73,8 +73,6 @@ export const config: LocaleConfig = { message: "Ліцензія GPL-3.0 | Політика конфіденційності", copyright: `Copyright © 2020 - ${new Date().getFullYear()} Kotatsu Developers`, }, - - components: components.filter(component => component.path.startsWith('ru/components/')), } } } diff --git a/.vitepress/theme/components/Breadcrumbs.vue b/.vitepress/theme/components/Breadcrumbs.vue index 7f90e2f..16419ff 100644 --- a/.vitepress/theme/components/Breadcrumbs.vue +++ b/.vitepress/theme/components/Breadcrumbs.vue @@ -1,7 +1,7 @@