-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.ts
41 lines (39 loc) · 1.33 KB
/
astro.config.ts
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
import remarkCollapse from "remark-collapse"
import remarkToc from "remark-toc"
import sitemap from "@astrojs/sitemap"
import remarkMath from "remark-math"
import rehypeMathjax from "rehype-mathjax"
import { SITE } from "./src/config"
import { defineConfig } from "astro/config"
/**
* Pattern wrapped in new RegExp('^(' + value + ')$', 'i') inside remarkToc and remarkCollapse
* Needed to match the heading title in the md file and insert the collapsible table of contents.
* Default pattern "(table[ -]of[ -])?contents?|toc" is replaced with a more precise one
* to enforce consistency in the markdown files.
*/
const CONTENTS_PATTERN = "table of contents"
// for configuration refer to https://astro.build/config
export default defineConfig({
integrations: [sitemap()],
markdown: {
rehypePlugins: [rehypeMathjax],
remarkPlugins: [
[remarkToc, { heading: CONTENTS_PATTERN }],
[
remarkCollapse,
{
summary: (toc: string) => toc,
test: CONTENTS_PATTERN,
},
],
remarkMath,
],
shikiConfig: {
theme: "dark-plus", // used for dark and light themes
wrap: true,
},
},
output: "static",
scopedStyleStrategy: "where",
site: SITE.url,
})