-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
75 lines (74 loc) · 1.94 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
import { defineConfig, envField } from 'astro/config';
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';
import partytown from '@astrojs/partytown';
import UnoCSS from 'unocss/astro';
import remarkBreaks from 'remark-breaks';
import remarkFlexibleCodeTitles from 'remark-flexible-code-titles';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
// https://astro.build/config
export default defineConfig({
site: 'https://changeofpace.site',
integrations: [
mdx(),
sitemap(),
UnoCSS({
injectReset: true,
}),
partytown({
config: {
forward: ['dataLayer.push'],
},
}),
],
build: {
format: 'file',
},
markdown: {
shikiConfig: {
theme: 'dark-plus',
},
remarkPlugins: [remarkBreaks, remarkFlexibleCodeTitles],
rehypePlugins: [
// デフォルトでは、Astro は rehype プラグインが実行された後に id 属性を注入する
// rehypeAutolinkHeadings 実行時に組み合わせて使用したいため、指定しておく
rehypeHeadingIds,
[
rehypeAutolinkHeadings,
{
behavior: 'append',
properties: {
className: ['ml-2', 'heading-link'],
},
content: {
type: 'text',
value: '#',
},
},
],
],
},
experimental: {
env: {
schema: {
GOOGLE_ANALYTICS_TAG: envField.string({
context: 'server',
access: 'public',
}),
GOOGLE_SITE_VERIFICATION: envField.string({
context: 'server',
access: 'public',
}),
PUBLIC_GOOGLE_ADSENSE_PUBLISHER_ID: envField.string({
context: 'client',
access: 'public',
}),
PUBLIC_GOOGLE_ADSENSE_SLOT: envField.string({
context: 'client',
access: 'public',
}),
},
},
},
});