Repository navigation
Expand file tree
/
Copy pathastro.config.mts
More file actions
64 lines (62 loc) 路 1.57 KB
/
Copy pathastro.config.mts
File metadata and controls
64 lines (62 loc) 路 1.57 KB
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
import { loadEnv } from 'vite'
import { defineConfig } from 'astro/config'
import sitemap from '@astrojs/sitemap'
import mdx from '@astrojs/mdx'
import tailwindcss from '@tailwindcss/vite'
import partytown from '@astrojs/partytown'
import expressiveCode from 'astro-expressive-code'
import remarkAlerts from 'remark-alerts'
import rehypeExternalLinks from 'rehype-external-links'
import { remarkReadingTime } from './lib/remark-reading-time'
import { unified } from '@astrojs/markdown-remark'
const { CF_PAGES_URL } = loadEnv(
process.env.NODE_ENV || 'development',
process.cwd(),
''
)
// https://astro.build/config
export default defineConfig({
site: CF_PAGES_URL,
vite: {
plugins: [tailwindcss()],
},
markdown: {
processor: unified({
remarkPlugins: [[remarkAlerts, { sanitize: false }], remarkReadingTime],
rehypePlugins: [
[
rehypeExternalLinks,
{
// @ts-ignore - TODO:
rel: (el) => {
if (!el.properties.href.includes('lwc.garden')) {
return ['nofollow noreferrer']
}
return []
},
target: '_blank',
},
],
],
}),
shikiConfig: {
// TODO: add custom theme
theme: 'one-dark-pro',
wrap: true,
},
},
integrations: [
partytown({
// Adds dataLayer.push as a forwarding-event.
config: {
forward: ['dataLayer.push', 'goatcounter.count'],
},
}),
expressiveCode({
// @ts-ignore
theme: 'one-dark-pro',
}),
mdx(),
sitemap(),
],
})