-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
53 lines (51 loc) · 1.66 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
import { defineConfig } from "astro/config";
import sitemap from "@astrojs/sitemap";
import remarkContentTags from "./plugins/remark-content-tags.mjs";
import remarkModifiedTime from "./plugins/remark-modified-time.mjs";
import remarkTitle from "./plugins/remark-title.mjs";
import remarkMath from "remark-math";
import remarkBreaks from "remark-breaks";
import rehypeKatex from "rehype-katex";
import remarkWikiLink from "remark-wiki-link";
// Gets all content files and create an array of slug strings for the remark wiki link plugin
const files = import.meta.glob("./src/content/**/*.md");
const permalinks = [];
for (const file in files)
permalinks.push(file.split("/").pop().replace(".md", "").replace(/\p{punct}/gu, "").replace(/ /g, "-").toLowerCase());
// https://astro.build/config
export default defineConfig({
output: "static",
site: "https://vinxis.moe",
integrations: [
sitemap(),
],
redirects: {
"/about": "/me",
"/now": "/me",
"/contact": "/me",
},
server: {
open: true,
},
markdown: {
remarkPlugins: [
remarkContentTags,
remarkModifiedTime,
remarkTitle,
remarkMath,
remarkBreaks,
[
remarkWikiLink,
{
permalinks,
pageResolver: (name) => [name.replace(/\p{punct}/gu, "").replace(/ /g, "-").toLowerCase()],
hrefTemplate: (permalink) => `../notes/${permalink}`,
newClassName: "invalid-internal-link",
},
],
],
rehypePlugins: [
rehypeKatex,
],
},
});