blog/astro.config.ts

57 lines
1.5 KiB
TypeScript
Raw Normal View History

2023-08-31 03:47:22 +00:00
import { defineConfig } from "astro/config";
import mdx from "@astrojs/mdx";
import sitemap from "@astrojs/sitemap";
2023-10-04 14:16:04 +00:00
import { rehypeAccessibleEmojis } from "rehype-accessible-emojis";
2023-09-01 15:09:01 +00:00
import remarkReadingTime from "./plugin/remark-reading-time";
2024-04-06 02:52:20 +00:00
import remarkEmoji from "remark-emoji";
2023-09-01 12:59:21 +00:00
import remarkDescription from "astro-remark-description";
2024-06-29 20:15:48 +00:00
import remarkAdmonitions, { mkdocsConfig } from "./plugin/remark-admonitions";
2023-09-01 17:05:29 +00:00
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
2024-04-05 15:34:32 +00:00
import remarkTypst from "./plugin/remark-typst";
2024-05-02 20:06:10 +00:00
import rehypeLinkHeadings from "@justfork/rehype-autolink-headings";
import rehypeSlug from "rehype-slug";
2023-08-31 03:47:22 +00:00
2024-05-02 20:06:10 +00:00
import markdoc from "@astrojs/markdoc";
2024-06-27 00:17:01 +00:00
import remarkAgda from "./plugin/remark-agda";
2023-10-11 16:48:34 +00:00
2024-06-27 05:22:46 +00:00
const outDir = "dist";
const base = process.env.BASE ?? "/";
const publicDir = "public";
2023-08-31 03:47:22 +00:00
// https://astro.build/config
export default defineConfig({
2024-06-27 05:22:46 +00:00
site: "https://mzhang.io",
integrations: [mdx(), sitemap(), markdoc()],
outDir,
base,
trailingSlash: "always",
publicDir,
markdown: {
syntaxHighlight: "shiki",
shikiConfig: { theme: "css-variables" },
remarkPlugins: [
() => remarkAgda({ outDir, base, publicDir }),
remarkMath,
2024-06-29 20:15:48 +00:00
[remarkAdmonitions, mkdocsConfig],
2024-06-27 05:22:46 +00:00
remarkReadingTime,
remarkTypst,
remarkEmoji,
[
remarkDescription,
{
name: "excerpt",
},
],
],
rehypePlugins: [
[rehypeKatex, {}],
rehypeAccessibleEmojis,
rehypeSlug,
[rehypeLinkHeadings, { behavior: "wrap" }],
],
},
2023-08-31 03:47:22 +00:00
});