mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 11:12:54 +02:00
chore: remove conditional loading of katex plugins
This commit is contained in:
parent
5d2989d66d
commit
afa47d4880
1 changed files with 20 additions and 25 deletions
|
@ -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: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue