-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
69 lines (66 loc) · 2.06 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { defineConfig } from "astro/config";
import mdx from "@astrojs/mdx";
import sitemap from "@astrojs/sitemap";
import tailwind from "@astrojs/tailwind";
import { transformerMetaWordHighlight, transformerMetaHighlight, transformerNotationDiff } from '@shikijs/transformers';
import vercel from "@astrojs/vercel/serverless";
import svelte from "@astrojs/svelte";
// https://astro.build/config
export default defineConfig({
site: "https://yusuf.fyi",
integrations: [mdx(), sitemap(), tailwind({
nesting: true
}), svelte()],
experimental: {
contentCollectionCache: true,
},
markdown: {
shikiConfig: {
// Choose from Shiki's built-in themes (or add your own)
// https://shiki.style/themes
theme: "vitesse-light",
// Add custom languages
// Note: Shiki has countless langs built-in, including .astro!
// https://shiki.style/languages
langs: [],
// Enable word wrap to prevent horizontal scrolling
wrap: true,
// Add custom transformers: https://shiki.style/guide/transformers
// Find common transformers: https://shiki.style/packages/transformers
transformers: [transformerMetaWordHighlight(), transformerMetaHighlight(), transformerNotationDiff(), {
pre(node) {
if (!this.options.meta) {
return;
}
if (!this.options.meta.__raw) {
return;
}
const meta = this.options.meta.__raw;
const titleMatch = meta.match(/title="([^"]*)"/);
const title = titleMatch?.[1] ?? null;
node.properties['data-title'] = title;
}
},
{
pre(node) {
if (!this.options.meta) {
return;
}
if (!this.options.meta.__raw) {
return;
}
const meta = this.options.meta.__raw;
const lineNumbers = meta.includes('line-numbers')
if (lineNumbers) node.properties['line-numbers'] = '';
}
}
]
}
},
output: "server",
adapter: vercel({
webAnalytics: {
enabled: true
}
})
});