-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
106 lines (76 loc) · 2.34 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import image from "@astrojs/image";
import tailwind from "@astrojs/tailwind";
import { defineConfig } from "astro/config";
import mdx from "@astrojs/mdx";
import remarkMath from 'remark-math';
import remarkBreaks from 'remark-breaks';
import rehypeMathjax from 'rehype-mathjax';
import rehypeSlug from 'rehype-slug';
import rehypeFigure from 'rehype-figure';
import remarkCodeTitles from 'remark-code-titles';
// https://astro.build/config
export default defineConfig({
site: "https://jav-ed.github.io",
base: "/web_Path",
markdown: {
remarkPlugins: [
remarkCodeTitles,
remarkMath,
remarkBreaks,
],
rehypePlugins: [
// Plugin to add `id`s to headings.
rehypeSlug,
// ['rehype-autolink-headings', {
// behavior: 'prepend'
// }],
// see: https://github.com/JS-DevTools/rehype-toc
// ['rehype-toc', { headings: ['h2', 'h3'] }],
// [addClasses, { 'h1,h2,h3': 'title' }],
/* -------------------------------- katex -------------------------------- */
// it should be more performant than MathJax, however, it firstly require an additional css to be loaded and secondly, labeling at the moment is achieved through manually giving tags --> not wanted
// see: https://github.com/KaTeX/KaTeX
// for options, see: https://katex.org/docs/options.html
// ['rehype-katex',
// {
// // fleqn: 'true',
// output: "htmlAndMathml"
// }],
[rehypeMathjax, {
loader: {
load: ['[tex]/color', '[tex]/tagformat']
},
tex: {
tags: 'all',
processRefs: 'true'
},
startup: {
ready: () => {
MathJax.startup.defaultReady();
MathJax.startup.promise.then(() => {
// Your custom JavaScript for equation numbering by chapter will be added here.
});
}
}
}],
rehypeFigure
]
},
integrations: [
tailwind(),
image({
serviceEntryPoint: "@astrojs/image/sharp",
}),
mdx({
// To inherit Markdown plugins in MDX, please use explicit imports in your config instead of "strings." --> install, import as variable and then add them
extendMarkdownConfig: true,
// remarkPlugins: [remarkMath],
// rehypePlugins: [rehypeMathjax],
})
],
vite: {
ssr: {
external: ["svgo"],
},
},
});