39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
|
|
import { defineConfig } from 'astro/config';
|
|||
|
|
import mdx from '@astrojs/mdx';
|
|||
|
|
import sitemap from '@astrojs/sitemap';
|
|||
|
|
import remarkMath from 'remark-math';
|
|||
|
|
import rehypeKatex from 'rehype-katex';
|
|||
|
|
import remarkWikilinks from './src/remark-wikilinks.mjs';
|
|||
|
|
|
|||
|
|
// https://astro.build/config
|
|||
|
|
export default defineConfig({
|
|||
|
|
site: 'https://sausagetoast.cloud',
|
|||
|
|
// 构建产物目录(nginx 指向此目录)
|
|||
|
|
build: {
|
|||
|
|
format: 'directory',
|
|||
|
|
},
|
|||
|
|
// 不使用 Astro 图片优化(环境无法编译 sharp),用 noop 服务兜底
|
|||
|
|
image: {
|
|||
|
|
service: { entrypoint: 'astro/assets/services/noop' },
|
|||
|
|
},
|
|||
|
|
integrations: [
|
|||
|
|
mdx(),
|
|||
|
|
sitemap({
|
|||
|
|
filter: (page) => !page.includes('/draft'),
|
|||
|
|
}),
|
|||
|
|
],
|
|||
|
|
markdown: {
|
|||
|
|
// 代码高亮:淡蓝底 + 柔和色调
|
|||
|
|
shikiConfig: {
|
|||
|
|
themes: {
|
|||
|
|
light: 'catppuccin-latte',
|
|||
|
|
dark: 'catppuccin-latte',
|
|||
|
|
},
|
|||
|
|
wrap: true,
|
|||
|
|
},
|
|||
|
|
// 数学公式:$...$ 行内,$$...$$ 块级,用 KaTeX 渲染
|
|||
|
|
remarkPlugins: [remarkMath, remarkWikilinks],
|
|||
|
|
rehypePlugins: [[rehypeKatex, { throwOnError: false, strict: false, output: 'html' }]],
|
|||
|
|
},
|
|||
|
|
});
|