Spaces:
Running
Running
| import { defineConfig } from 'astro/config'; | |
| import mdx from '@astrojs/mdx'; | |
| import mermaid from 'astro-mermaid'; | |
| import compressor from 'astro-compressor'; | |
| import remarkMath from 'remark-math'; | |
| import rehypeKatex from 'rehype-katex'; | |
| import remarkFootnotes from 'remark-footnotes'; | |
| import rehypeSlug from 'rehype-slug'; | |
| import rehypeAutolinkHeadings from 'rehype-autolink-headings'; | |
| import rehypeCitation from 'rehype-citation'; | |
| import rehypeCodeCopyAndLabel from './plugins/rehype/code-copy-and-label.mjs'; | |
| import rehypeReferencesAndFootnotes from './plugins/rehype/post-citation.mjs'; | |
| import remarkIgnoreCitationsInCode from './plugins/remark/ignore-citations-in-code.mjs'; | |
| import rehypeRestoreAtInCode from './plugins/rehype/restore-at-in-code.mjs'; | |
| import rehypeWrapTables from './plugins/rehype/wrap-tables.mjs'; | |
| // Built-in Shiki (dual themes) — no rehype-pretty-code | |
| // Plugins moved to app/plugins/* | |
| export default defineConfig({ | |
| output: 'static', | |
| integrations: [ | |
| mermaid({ theme: 'forest', autoTheme: true }), | |
| mdx(), | |
| // Precompress output with Gzip only (Brotli disabled due to server module mismatch) | |
| compressor({ brotli: false, gzip: true }) | |
| ], | |
| devToolbar: { | |
| enabled: false | |
| }, | |
| markdown: { | |
| shikiConfig: { | |
| themes: { | |
| light: 'github-light', | |
| dark: 'github-dark' | |
| }, | |
| defaultColor: false, | |
| wrap: false, | |
| langAlias: { | |
| // Map MDX fences to TSX for better JSX tokenization | |
| mdx: 'tsx' | |
| } | |
| }, | |
| remarkPlugins: [ | |
| remarkIgnoreCitationsInCode, | |
| remarkMath, | |
| [remarkFootnotes, { inlineNotes: true }] | |
| ], | |
| rehypePlugins: [ | |
| rehypeSlug, | |
| [rehypeAutolinkHeadings, { behavior: 'wrap' }], | |
| rehypeKatex, | |
| [rehypeCitation, { | |
| bibliography: 'src/content/bibliography.bib', | |
| linkCitations: true | |
| }], | |
| rehypeReferencesAndFootnotes, | |
| rehypeRestoreAtInCode, | |
| rehypeCodeCopyAndLabel, | |
| rehypeWrapTables | |
| ] | |
| } | |
| }); | |