generated from mhyfritz/astro-landing-page
-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
75 lines (73 loc) · 2.4 KB
/
astro.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import tailwind from "@astrojs/tailwind";
import { defineConfig } from "astro/config";
import remarkDirective from "remark-directive";
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
import remarkDirectiveRehype from "remark-directive-rehype";
import { citePlugin as remarkCite } from "@benrbray/remark-cite";
import { remarkBibliography } from "remark-preset-obsidian";
import remarkGfm from "remark-gfm";
import mdx from "@astrojs/mdx";
import svelte from "@astrojs/svelte";
import remarkSmartypants from "remark-smartypants";
import rehypeStringify from "rehype-stringify";
import rehypeRaw from "rehype-raw";
import { visit } from "unist-util-visit";
import { getReferences, extractCitations } from "remark-preset-obsidian";
import bibliography from "./public/bibliography.json";
// https://astro.build/config
import solidJs from "@astrojs/solid-js";
// https://astro.build/config
export default defineConfig({
site: "https://agi-curriculum.vercel.app",
integrations: [tailwind(), mdx(), svelte(), solidJs()],
vite: {
ssr: {
external: ["@11ty/eleventy-img", "svgo"]
}
},
markdown: {
extendDefaultPlugins: true,
remarkPlugins: [remarkSmartypants, remarkGfm, remarkMath, remarkDirective, remarkDirectiveRehype, [remarkCite, {
syntax: {
// see micromark-extension-cite
enableAltSyntax: false,
enablePandocSyntax: true
},
toMarkdown: {
// see mdast-util-cite
standardizeAltSyntax: false,
enableAuthorSuppression: true,
useNodeValue: false
}
}],
() => (tree, file) => {
// console.log("HERE", JSON.stringify(tree, null, 2));
const citations = extractCitations(tree);
const references = getReferences(citations, bibliography).map(ref => ref.replace("↩️", "↩"));
file.data.astro.frontmatter.citations = references;
},
[remarkBibliography, {
bibliography: []
}],
],
rehypePlugins: [
// rehypeRaw,
[rehypeKatex, {
macros: {
"\\RR": "\\mathbb{R}",
"\\ZZ": "\\mathbb{Z}",
"\\CC": "\\mathbb{C}",
"\\QQ": "\\mathbb{Q}",
"\\NN": "\\mathbb{N}",
"\\FF": "\\mathbb{F}",
"\\FF": "\\mathbb{F}",
"\\B": "\\boldsymbol{#1}",
"\\b": "\\mathbf{#1}",
"\\id": "\\htmlId{eq:#1}{#2}",
"\\t": "\\htmlId{eq:#1}{#2} \\tag{#1}"
},
trust: true
}]]
}
});