-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
47 lines (46 loc) · 1.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
import { defineConfig } from "astro/config";
import vue from "@astrojs/vue";
import remarkGithubAlerts from "remark-github-alerts";
import icon from "astro-icon";
import remarkReadingTime from "./src/utils/remark-reading-time.mjs";
import rehypeExtendedLinks from "rehype-extended-links";
import tailwind from '@astrojs/tailwind';
import sitemap from "@astrojs/sitemap";
// https://astro.build/config
export default defineConfig({
site: "https://yfi.moe/",
integrations: [tailwind(), vue(), icon(), sitemap()],
markdown: {
remarkPlugins: [remarkGithubAlerts, remarkReadingTime],
rehypePlugins: [[rehypeExtendedLinks, {
preContent(node) {
const url = node.properties.href;
if (!url) return undefined;
const regex = /^(https?:\/\/)?(www\.)?github\.com\/.*/i;
if (!regex.test(url)) return undefined;
return {
type: "element",
tagName: "span",
properties: {
className: ["i-mingcute-github-fill"]
},
children: []
};
},
content: {
type: "element",
tagName: "span",
properties: {
className: ["i-mingcute-external-link-line"]
},
children: []
}
}]],
remarkRehype: {
allowDangerousHtml: true
},
shikiConfig: {
theme: "catppuccin-macchiato"
}
}
});