1- import type { Theme } from "../theme/types" ;
2- import { defineConfigWithTheme } from "vitepress" ;
3- import { config as root , searchLocale as searchLocaleEn } from "./en" ;
4- import { addPlugins } from "../theme/plugins/markdown" ;
5- import { sections , prepareData } from "../theme/plugins/section" ;
6- import { slugify } from "transliteration" ;
1+ // @ts -expect-error Missing types
2+ import shortcode_plugin from "markdown-it-shortcode-tag" ;
73import { fileURLToPath , URL } from "node:url" ;
8- import { telegram } from "../../website/icons" ;
4+ import { slugify } from "transliteration" ;
5+ import { defineConfigWithTheme } from "vitepress" ;
96import { tabsMarkdownPlugin } from "vitepress-plugin-tabs" ;
10- import shortcode_plugin from "markdown-it-shortcode-tag" ;
11- import shortcodes from "./shortcodes" ;
12- import generateOgImages from "./hooks/generateOgImages" ;
7+
8+ import type { ThemeConfig } from "../theme/types" ;
9+
10+ import { telegram } from "../../website/icons" ;
11+ import { addPlugins } from "../theme/plugins/markdown" ;
12+ import { prepareData , sections } from "../theme/plugins/section" ;
13+ import { config as root , searchLocale as searchLocaleEn } from "./en" ;
1314import generateMeta from "./hooks/generateMeta" ;
15+ import generateOgImages from "./hooks/generateOgImages" ;
16+ import shortcodes from "./shortcodes" ;
1417
1518const SITE_HOST = "https://kotatsu.app" ;
1619const SITE_TITLE = "kotatsu.app" ;
1720const SITE_TITLE_SEPARATOR = " / " ;
1821
19- export default defineConfigWithTheme < Theme . Config > ( {
22+ export default defineConfigWithTheme < ThemeConfig > ( {
2023 lastUpdated : true ,
2124 cleanUrls : true ,
2225
@@ -36,8 +39,8 @@ export default defineConfigWithTheme<Theme.Config>({
3639 . trim ( )
3740 . replace ( / ^ \d * / g, "" ) // Удаление чисел из начала строки
3841 . replace ( / [ ^ a - z A - Z а - я А - Я Ё ё 0 - 9 \- \s ] / g, "" ) // Удаление ненужных символов
39- . replace ( / \s \ -\s / , "-" )
40- . replace ( / \ -+ / g, "-" ) // Избавление от повторяющихся символов
42+ . replace ( / \s - \s / , "-" )
43+ . replace ( / - + / g, "-" ) // Избавление от повторяющихся символов
4144 . replace ( / ^ ( .{ 25 } [ ^ \s ] * ) .* / , "$1" ) ; // Ограничение количества символов
4245
4346 return encodeURIComponent ( slugify ( str , { lowercase : true } ) ) ;
@@ -102,7 +105,7 @@ export default defineConfigWithTheme<Theme.Config>({
102105 vite : {
103106 resolve : {
104107 alias : [ "VPSidebar" , "VPNavBarTranslations" , "VPNavScreenTranslations" , "VPNavBar" , "VPNavBarMenu" , "VPNavScreenMenu" , "VPFooter" ] . map ( ( componentName ) => ( {
105- find : new RegExp ( `^.*\ /${ componentName } \ .vue$` ) ,
108+ find : new RegExp ( `^.*/${ componentName } .vue$` ) ,
106109 replacement : fileURLToPath ( new URL ( `../theme/components/${ componentName . replace ( / ^ V P / , "" ) } .vue` , import . meta. url ) ) ,
107110 } ) ) ,
108111 } ,
0 commit comments