generated from wanoo21/tailwind-astro-starting-blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
93 lines (84 loc) · 2.27 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import mdx from '@astrojs/mdx'
import sitemap from '@astrojs/sitemap'
import tailwind from '@astrojs/tailwind'
import { defineConfig } from 'astro/config'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeKatex from 'rehype-katex'
import rehypeShikiji from 'rehype-shikiji'
import rehypeSlug from 'rehype-slug'
import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'
import remarkReadingTime from 'remark-reading-time'
import readingMdxTime from 'remark-reading-time/mdx'
import remarkSmartypants from 'remark-smartypants'
import remarkToc from 'remark-toc'
import vitesseDark from 'shikiji/themes/vitesse-dark'
import vitesseLight from 'shikiji/themes/vitesse-light'
import {
transformerMetaHighlight,
transformerMetaWordHighlight,
transformerNotationDiff,
transformerNotationErrorLevel,
transformerNotationFocus,
transformerNotationHighlight,
transformerNotationWordHighlight,
} from 'shikiji-transformers'
import { SITE_METADATA } from './src/consts.ts'
const vitesseLightOverride = {
...vitesseLight,
bg: 'var(--color-code-light-bg)',
fg: 'var(--color-code-light-fg)',
}
const vitesseDarkOverride = {
...vitesseDark,
bg: 'var(--color-code-dark-bg)',
fg: 'var(--color-code-dark-fg)',
}
const shikiji_transformers = [
transformerMetaHighlight,
transformerMetaWordHighlight,
transformerNotationDiff,
transformerNotationErrorLevel,
transformerNotationFocus,
transformerNotationHighlight,
transformerNotationWordHighlight,
]
// https://astro.build/config
export default defineConfig({
prefetch: true,
site: SITE_METADATA.siteUrl,
integrations: [mdx(), sitemap(), tailwind()],
markdown: {
syntaxHighlight: false,
rehypePlugins: [
rehypeSlug,
[
rehypeAutolinkHeadings,
{
behavior: 'wrap',
properties: { class: 'header-link' },
},
],
rehypeKatex,
[
rehypeShikiji,
{
themes: {
light: vitesseLightOverride,
dark: vitesseDarkOverride,
},
transformers: shikiji_transformers,
wrap: true,
},
],
],
remarkPlugins: [
remarkMath,
remarkSmartypants,
remarkGfm,
remarkToc,
remarkReadingTime,
readingMdxTime,
],
},
})