-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
51 lines (48 loc) · 1.17 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
import { defineConfig } from "astro/config";
import inspectUrls from "@samdev-7/rehype-url-inspector";
import sitemap from "@astrojs/sitemap";
import react from "@astrojs/react";
// https://astro.build/config
export default defineConfig({
site: "https://guissmo.com",
base: ".",
experimental: {
// contentCollectionCache: true,
},
markdown: {
remarkPlugins: ["remark-math"],
remarkRehype: {
footnoteLabelTagName: "h1",
},
rehypePlugins: [
[
"rehype-katex",
{
// Katex plugin options
},
],
[
inspectUrls,
{
selectors: ["a[href]"],
inspectEach(url) {
// Check if the link is external
const href = url.node.properties.href;
// Check if the link is external (i.e., includes 'http' or 'https')
const isExternal = /^https?:\/\//i.test(href);
// Set target="_blank" only for external links
if (isExternal) {
url.node.properties.target = "_blank";
}
},
},
],
],
},
integrations: [
react(),
sitemap({
entryLimit: 10000,
}),
],
});