|
|
import { defineConfig } from 'astro/config'; |
|
|
import mdx from '@astrojs/mdx'; |
|
|
import svelte from '@astrojs/svelte'; |
|
|
import mermaid from 'astro-mermaid'; |
|
|
import compressor from 'astro-compressor'; |
|
|
import remarkMath from 'remark-math'; |
|
|
import rehypeKatex from 'rehype-katex'; |
|
|
import rehypeSlug from 'rehype-slug'; |
|
|
import rehypeAutolinkHeadings from 'rehype-autolink-headings'; |
|
|
import rehypeCodeCopy from './plugins/rehype/code-copy.mjs'; |
|
|
import remarkDirective from 'remark-directive'; |
|
|
import remarkOutputContainer from './plugins/remark/output-container.mjs'; |
|
|
import rehypeWrapTables from './plugins/rehype/wrap-tables.mjs'; |
|
|
import rehypeWrapOutput from './plugins/rehype/wrap-outputs.mjs'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default defineConfig({ |
|
|
output: 'static', |
|
|
integrations: [ |
|
|
mermaid({ theme: 'forest', autoTheme: true }), |
|
|
mdx(), |
|
|
svelte(), |
|
|
|
|
|
compressor({ brotli: false, gzip: true }) |
|
|
], |
|
|
devToolbar: { |
|
|
enabled: false |
|
|
}, |
|
|
markdown: { |
|
|
shikiConfig: { |
|
|
themes: { |
|
|
light: 'github-light', |
|
|
dark: 'github-dark' |
|
|
}, |
|
|
defaultColor: false, |
|
|
wrap: false, |
|
|
langAlias: { |
|
|
|
|
|
mdx: 'tsx' |
|
|
} |
|
|
}, |
|
|
remarkPlugins: [ |
|
|
remarkMath, |
|
|
remarkDirective, |
|
|
remarkOutputContainer |
|
|
], |
|
|
rehypePlugins: [ |
|
|
rehypeSlug, |
|
|
[rehypeAutolinkHeadings, { behavior: 'wrap' }], |
|
|
[rehypeKatex, { |
|
|
trust: true, |
|
|
}], |
|
|
rehypeCodeCopy, |
|
|
rehypeWrapOutput, |
|
|
rehypeWrapTables |
|
|
] |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
|