diff --git a/.vitepress/config/ru.ts b/.vitepress/config/ru.ts index 7037a41..104e387 100644 --- a/.vitepress/config/ru.ts +++ b/.vitepress/config/ru.ts @@ -1,7 +1,8 @@ import type { DefaultTheme, LocaleConfig } from 'vitepress' -import type { Theme } from '../theme/types' +import type { CustomConfig, Theme } from '../theme/types' import { sections } from '../theme/plugins/section' import 'dotenv/config' +import { baseHelper } from '../theme/utils' export const SITE_NAME = 'Kotatsu Website' export const META_DESCRIPTION = 'Простая и удобная читалка манги с открытым исходным кодом от сообщества и для сообщества, где вы можете найти и читать вашу любимую мангу проще как никогда.' @@ -45,7 +46,7 @@ export const config: LocaleConfig = { nav: getNav(), sidebar: { - + "/": defaultSidebar(), }, outline: { @@ -70,16 +71,147 @@ export const config: LocaleConfig = { pattern: 'https://github.com/KotatsuApp/website/edit/main/website/:path', text: 'Предложить изменения на этой странице', }, - footer: { - message: "Лицензия GPL-3.0 | Политика конфиденциальности", - copyright: `Copyright © 2020 - ${new Date().getFullYear()} Kotatsu Developers`, - }, + footer: baseHelper(getFooter(), ''), sections: sections }, } } +function defaultSidebar(): DefaultTheme.SidebarItem[] { + return [ + { + text: "General sections", + items: [ + { + text: "Download", + link: "/download/", + }, + /* { + text: "Parsers", + link: "/parsers/", + }, */ + { + text: "Changelogs", + link: "/changelogs/", + }, + ], + }, + /* { + text: "Other projects", + items: [ + { + text: "Kotatsu SSIV" + }, + { + text: "kotatsu-dl" + } + ] + }, */ + { + text: "Frequently Asked Questions", + items: [ + { text: "General", link: "/manuals/faq/general/" }, + { + text: "Feed", + link: "/manuals/faq/feed/", + }, + { + text: "Explore", + link: "/manuals/faq/explore/", + collapsed: true, + items: [ + { + text: "Sources", + link: "/manuals/faq/explore/sources/" + }, + /* { + text: "Local storage", + link: "/manuals/faq/explore/local-storage", + }, */ + /* { + text: "Bookmarks", + link: "/manuals/faq/explore/bookmarks", + }, + { + text: "Random", + link: "/manuals/faq/explore/random", + }, */ + { + text: "Downloads", + link: "/manuals/faq/explore/downloads/", + }, + /* { + text: "Suggestions", + link: "/manuals/faq/explore/suggestions", + }, */ + ], + }, + { + text: "Reader", + link: "/manuals/faq/reader/", + }, + { + text: "Settings", + link: "/manuals/faq/settings/", + }, + { + text: "Miscellaneous", + link: "/manuals/faq/miscellaneous/" + } + ], + }, + { + text: "Guides", + items: [ + { + text: "Getting started", + link: "/manuals/guides/getting-started/", + }, + { + text: "Troubleshooting", + link: "/manuals/guides/troubleshooting/", + collapsed: true, + items: [ + { + text: "Common issues", + link: "/manuals/guides/troubleshooting/common-issues/", + }, + { + text: "Diagnosis", + link: "/manuals/guides/troubleshooting/diagnosis/", + }, + ], + }, + { text: "Backups", link: "/manuals/guides/backups/" }, + { text: "Tracking", link: "/manuals/guides/tracking/" }, + { text: "Categories", link: "/manuals/guides/categories/" }, + { + text: "Synchronization", + link: "/manuals/guides/synchronization/" + } + ], + }, + { + text: "For developers", + items: [ + { + text: "Contribute", + link: "/dev/contribute/", + }, + { + text: "Parsers library", + link: "/dev/parsers-library/", + }, + { + text: "Synchronization server", + link: "/dev/sync-server/", + }, + ] + } + ] +} + function getNav(): DefaultTheme.NavItem[] { return [ { @@ -91,20 +223,48 @@ function getNav(): DefaultTheme.NavItem[] { link: "/ru/download/", }, { - text: "Изменения в версиях", + text: "Чейнджлоги", link: "/ru/changelogs/", }, ], }, { - text: "Инструкции", - link: "/ru/manuals/guides/getting-started", + text: "Руководства", + link: "/ru/manuals/guides/getting-started/", activeMatch: "/ru/manuals/", }, - { - text: "Новости", - link: "/ru/news/", - activeMatch: "/ru/news/", - }, +/* { + text: "Desktop app", + link: "/desktop/", + activeMatch: "/desktop/", + }, */ +/* { + text: "News", + link: "/news/", + activeMatch: "/news/" + } */ ] +} + +function getFooter(): CustomConfig['footer'] { + return { + qrcodeTitle: 'Чат в Telegram', + qrcodeMessage: 'Присоеднияйтесь!', + qrcodeLink: 'https://t.me/kotatsuapp', + navigation: [ + { + title: 'Legal', + items: [ + { + text: 'Конфиденциальность', + link: '/ru/privacy/', + }, + { + text: 'DMCA дисклеймер', + link: '/ru/dmca/', + }, + ], + }, + ], + } } \ No newline at end of file diff --git a/.vitepress/config/shortcodesTitles.ts b/.vitepress/config/shortcodesTitles.ts new file mode 100644 index 0000000..ef72bba --- /dev/null +++ b/.vitepress/config/shortcodesTitles.ts @@ -0,0 +1,10 @@ +import { type Ref, computed } from 'vue' +import { useData } from 'vitepress' + +export interface Data { + lang: Ref +} + +const { lang }: Data = useData() + +export const main_three_dots = computed(() => (lang.value === 'ru') ? ('Переводчик') : ((lang.value === 'ua') ? ('Перекладач') : ('Translator'))) \ No newline at end of file diff --git a/.vitepress/theme/components/Changelog.vue b/.vitepress/theme/components/Changelog.vue index 9606b31..de92772 100644 --- a/.vitepress/theme/components/Changelog.vue +++ b/.vitepress/theme/components/Changelog.vue @@ -12,7 +12,7 @@ const changelog = computed(() => { const flavoredString = (release[type.value].body ?? "") .replace(/(?<=\(|(, ))@(.*?)(?=\)|(, ))/g, "[@$2](https://github.com/$2)") .replace("https://github.com/KotatsuApp/Kotatsu/releases", "/changelogs/") - .replace("##", "-") + .replace(/## [ \t]*([^\n\r]*)/g, "### $1") return md.render(flavoredString) }) @@ -72,34 +72,6 @@ const changelog = computed(() => { color: var(--vp-c-text-2) font-size: 0.9rem } - - table { - border-radius: 8px - border-collapse: collapse - border: 1px solid var(--vp-c-divider) - - tr, - th, - td { - border: none - width: 100% - } - - tbody tr { - border-top: 1px solid var(--vp-c-divider) - } - - tr > td { - &:first-child { - color: var(--vp-c-text-2) - } - - &:last-child { - font-family: var(--vp-font-family-mono) - font-size: var(--vp-code-font-size) - } - } - } } .fullChangelog { diff --git a/.vitepress/theme/components/ChangelogsList.vue b/.vitepress/theme/components/ChangelogsList.vue index 76e6f9c..1071e7b 100644 --- a/.vitepress/theme/components/ChangelogsList.vue +++ b/.vitepress/theme/components/ChangelogsList.vue @@ -13,6 +13,7 @@ function renderMarkdown(string: string | null | undefined) { .replace(/#(\d+)/g, "[#$1](https://github.com/KotatsuApp/Kotatsu/issues/$1)") .replace(/^Check out the .*past release notes.* if you're.*$/m, "") .replace(/https\:\/\/github.com\/KotatsuApp\/Kotatsu\/releases\/tag\/(.*?)/g, "#$1") + .replace(/## [ \t]*([^\n\r]*)/g, "### $1") .trim() return md.render(flavoredString) diff --git a/.vitepress/theme/components/DownloadButtons.vue b/.vitepress/theme/components/DownloadButtons.vue index 4797205..d49e623 100644 --- a/.vitepress/theme/components/DownloadButtons.vue +++ b/.vitepress/theme/components/DownloadButtons.vue @@ -29,28 +29,6 @@ function handleAnalytics() {