-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
49 lines (42 loc) · 1.05 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
import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
import inspectUrls from "@samdev-7/rehype-url-inspector";
import react from "@astrojs/react";
import vercel from "@astrojs/vercel";
// https://astro.build/config
export default defineConfig({
prefetch: {
prefetchAll: true,
defaultStrategy: "hover",
},
integrations: [
tailwind(),
react({
include: ["**/react/*"],
}),
],
markdown: {
rehypePlugins: [
[
inspectUrls,
{
selectors: ["a[href]"],
inspectEach(url) {
if (
url.node.properties.title &&
url.node.properties.href == "tooltip"
) {
url.node.tagName = "span";
delete url.node.properties.href;
url.node.properties.class = "tooltip";
return;
}
if (url.node.properties.href.startsWith("/")) return;
url.node.properties.target = "_blank";
},
},
],
],
},
adapter: vercel(),
});