diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index a079c4b4..25021350 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,7 +1,7 @@ +import { transformerTwoslash } from '@shikijs/vitepress-twoslash'; import { MermaidConfig } from 'mermaid'; import { defineConfig } from 'vitepress'; import { withMermaid } from 'vitepress-plugin-mermaid'; -import { transformerTwoslash } from '@shikijs/vitepress-twoslash'; import { DocumentName, documentService } from '../services/DocumentService'; import { sidebarService } from '../services/SidebarService'; import { themeService } from '../services/ThemeService'; @@ -17,8 +17,8 @@ const vitepressConfig = defineConfig({ markdown: { lineNumbers: true, theme: { - light: await themeService.getTheme('Eva-Light'), - dark: await themeService.getTheme('Eva-Dark'), + light: await themeService.getTheme('Eva Light'), + dark: await themeService.getTheme('Eva Dark'), }, codeTransformers: [transformerTwoslash()], }, diff --git a/docs/services/ThemeService.ts b/docs/services/ThemeService.ts index ae6a5815..b431179b 100644 --- a/docs/services/ThemeService.ts +++ b/docs/services/ThemeService.ts @@ -20,8 +20,8 @@ export type RemoteThemeInfo = { }; const themeInfos = { - 'Eva-Light': { repo: 'fisheva/Eva-Theme', path: 'themes/Eva-Light.json', branch: 'master' }, - 'Eva-Dark': { repo: 'fisheva/Eva-Theme', path: 'themes/Eva-Dark.json', branch: 'master' }, + 'Eva Light': { repo: 'fisheva/Eva-Theme', path: 'themes/Eva-Light.json', branch: 'master' }, + 'Eva Dark': { repo: 'fisheva/Eva-Theme', path: 'themes/Eva-Dark.json', branch: 'master' }, } satisfies Record; export type ThemeName = keyof typeof themeInfos; class ThemeService implements IThemeService { @@ -42,7 +42,9 @@ class ThemeService implements IThemeService { const url = (await getRepoFileInfo(info.repo, info.path)).download_url!; try { const response = await axios.get(url, { responseType: 'text' }); - return (await import('jsonc-parser')).parse(response.data) as TextmateTheme; + const theme = (await import('jsonc-parser')).parse(response.data) as TextmateTheme; + console.log(theme.name); + return theme; } catch (error) { console.error('Error fetching JSON data:', error); throw error;