diff --git a/astro.config.ts b/astro.config.ts index e1bc6cb..704e41f 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -18,7 +18,6 @@ import { remarkReadingTime } from './src/plugins/remark-reading-time.mjs' const url = themeConfig.site.url const locale = themeConfig.global.locale -const isKatexEnabled = themeConfig.global.katex const linkPrefetch = themeConfig.preload.linkPrefetch const imageHostURL = themeConfig.preload.imageHostURL const imageConfig = imageHostURL @@ -32,28 +31,6 @@ const imageConfig = imageHostURL } : {} -const remarkPlugins = [ - remarkDirective, - ...(isKatexEnabled ? [remarkMath] : []), - remarkAdmonitions, - remarkGithubCard, - remarkReadingTime, -] - -const rehypePlugins = [ - rehypeSlug, - ...(isKatexEnabled ? [rehypeKatex] : []), - rehypeImgToFigure, - [ - rehypeExternalLinks, - { - target: '_blank', - rel: ['nofollow', 'noopener', 'noreferrer', 'external'], - protocols: ['http', 'https', 'mailto'], - }, - ], -] as any[] - export default defineConfig({ site: url, base: '/', @@ -84,8 +61,26 @@ export default defineConfig({ robotsTxt(), ], markdown: { - remarkPlugins, - rehypePlugins, + remarkPlugins: [ + remarkDirective, + remarkMath, + remarkAdmonitions, + remarkGithubCard, + remarkReadingTime, + ], + rehypePlugins: [ + rehypeSlug, + rehypeKatex, + rehypeImgToFigure, + [ + rehypeExternalLinks, + { + target: '_blank', + rel: ['nofollow', 'noopener', 'noreferrer', 'external'], + protocols: ['http', 'https', 'mailto'], + }, + ], + ], shikiConfig: { // Available themes: https://shiki.style/themes themes: {