-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.mjs
More file actions
25 lines (23 loc) · 788 Bytes
/
Copy pathastro.config.mjs
File metadata and controls
25 lines (23 loc) · 788 Bytes
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
import { defineConfig } from "astro/config";
import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
const sanitizeSchema = {
...defaultSchema,
tagNames: [...(defaultSchema.tagNames ?? []), "aside", "details", "summary"],
attributes: {
...(defaultSchema.attributes ?? {}),
"*": [...((defaultSchema.attributes && defaultSchema.attributes["*"]) ?? []), "className"],
a: [...((defaultSchema.attributes && defaultSchema.attributes.a) ?? []), "target", "rel"],
img: [
...((defaultSchema.attributes && defaultSchema.attributes.img) ?? []),
"loading",
"decoding",
"referrerpolicy"
]
}
};
export default defineConfig({
site: "https://gsisinna.github.io",
markdown: {
rehypePlugins: [[rehypeSanitize, sanitizeSchema]]
}
});