-
Notifications
You must be signed in to change notification settings - Fork 1
/
astro.config.mjs
81 lines (80 loc) · 1.95 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
import { defineConfig } from "astro/config";
import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import {
rehypeAddAltText,
rehypeCustomEmoji,
ownLineFootnote,
} from "/src/utils/mdx-utils.ts";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypeSlug from "rehype-slug";
import rehypeToc from "rehype-toc";
import vercel from "@astrojs/vercel/serverless";
import expressiveCode from "astro-expressive-code";
import metaTags from "astro-meta-tags";
// https://astro.build/config
export default defineConfig({
// ...
integrations: [
expressiveCode({
theme: ["dracula-soft"],
}),
mdx(),
react(),
metaTags(),
],
markdown: {
remarkPlugins: [],
rehypePlugins: [
rehypeSlug,
[
rehypeAutolinkHeadings,
{
behavior: "wrap",
},
],
ownLineFootnote,
[
rehypeToc,
{
customizeTOC: (toc) => {
if (toc.children[0].children?.length > 0) {
return toc;
}
return false;
},
customizeTOCItem: (toc, heading) => {
const headingContent = heading.children?.[0];
if (headingContent.children.length > 1) {
toc.children[0].children = headingContent.children;
}
return toc;
},
},
],
[
rehypeCustomEmoji,
{
emojis: {
bobaparty: "/emojis/bobaparty.png",
bobatwt: "/emojis/bobatwt.png",
bobaeyes: "/emojis/bobaeyes.png",
},
className: "custom-emoji",
},
],
rehypeAddAltText,
],
},
redirects: {
"/subscribe": "/support-me",
"/support-me": "https://www.patreon.com/fujocoded",
"/streams": {
status: 307,
destination: "/posts/24-11-stream-schedule",
},
},
output: "hybrid",
adapter: vercel(),
site: "https://www.essentialrandomness.com",
});