mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 19:51:07 +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 url = themeConfig.site.url
|
||||||
const locale = themeConfig.global.locale
|
const locale = themeConfig.global.locale
|
||||||
const isKatexEnabled = themeConfig.global.katex
|
|
||||||
const linkPrefetch = themeConfig.preload.linkPrefetch
|
const linkPrefetch = themeConfig.preload.linkPrefetch
|
||||||
const imageHostURL = themeConfig.preload.imageHostURL
|
const imageHostURL = themeConfig.preload.imageHostURL
|
||||||
const imageConfig = 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({
|
export default defineConfig({
|
||||||
site: url,
|
site: url,
|
||||||
base: '/',
|
base: '/',
|
||||||
|
@ -84,8 +61,26 @@ export default defineConfig({
|
||||||
robotsTxt(),
|
robotsTxt(),
|
||||||
],
|
],
|
||||||
markdown: {
|
markdown: {
|
||||||
remarkPlugins,
|
remarkPlugins: [
|
||||||
rehypePlugins,
|
remarkDirective,
|
||||||
|
remarkMath,
|
||||||
|
remarkAdmonitions,
|
||||||
|
remarkGithubCard,
|
||||||
|
remarkReadingTime,
|
||||||
|
],
|
||||||
|
rehypePlugins: [
|
||||||
|
rehypeSlug,
|
||||||
|
rehypeKatex,
|
||||||
|
rehypeImgToFigure,
|
||||||
|
[
|
||||||
|
rehypeExternalLinks,
|
||||||
|
{
|
||||||
|
target: '_blank',
|
||||||
|
rel: ['nofollow', 'noopener', 'noreferrer', 'external'],
|
||||||
|
protocols: ['http', 'https', 'mailto'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
shikiConfig: {
|
shikiConfig: {
|
||||||
// Available themes: https://shiki.style/themes
|
// Available themes: https://shiki.style/themes
|
||||||
themes: {
|
themes: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue