-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathastro.config.mjs
54 lines (50 loc) · 1.41 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
import { defineConfig } from 'astro/config';
import { remarkReadingTime } from './src/utils/readingTime';
import rehypePrettyCode from 'rehype-pretty-code';
import vercelStatic from '@astrojs/vercel';
import tailwindcss from '@tailwindcss/vite';
import react from '@astrojs/react';
import sitemap from '@astrojs/sitemap';
const options = {
// Specify the theme to use or a custom theme json, in our case
// it will be a moonlight-II theme from
// https://github.com/atomiks/moonlight-vscode-theme/blob/master/src/moonlight-ii.json
// Callbacks to customize the output of the nodes
//theme: json,
onVisitLine(node) {
// Prevent lines from collapsing in `display: grid` mode, and
// allow empty lines to be copy/pasted
if (node.children.length === 0) {
node.children = [
{
type: 'text',
value: ' '
}
];
}
},
onVisitHighlightedLine(node) {
// Adding a class to the highlighted line
node.properties.className = ['highlighted'];
}
};
// https://astro.build/config
export default defineConfig({
site: 'https://astro-tech-blog-ten.vercel.app/',
markdown: {
syntaxHighlight: false,
// Disable syntax built-in syntax hightlighting from astro
rehypePlugins: [[rehypePrettyCode, options]],
remarkPlugins: [remarkReadingTime]
},
integrations: [react(), sitemap()],
output: 'static',
adapter: vercelStatic({
webAnalytics: {
enabled: true
}
}),
vite: {
plugins: [tailwindcss()]
}
});