-
Notifications
You must be signed in to change notification settings - Fork 38
/
astro.config.mjs
143 lines (137 loc) · 4.22 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import { defineConfig } from "astro/config";
import { CODE_THEME } from "./src/consts.ts";
import mdx from "@astrojs/mdx";
import icon from "astro-icon";
import terser from "@rollup/plugin-terser";
import sitemap from "@astrojs/sitemap";
import pagefind from "astro-pagefind";
import tailwind from "@astrojs/tailwind";
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
import rehypeExternalLinks from 'rehype-external-links';
import playformCompress from "@playform/compress";
import swup from "@swup/astro";
import astroI18next from "astro-i18next";
import { transformers } from './src/config/transformers.js';
import { rehypeFadeInUp } from './src/plugins/rehype-fade-in-up.mjs';
import { remarkAddAnchor } from './src/plugins/remark-add-anchor.mjs';
import { remarkReadingTime } from './src/plugins/remark-reading-time.mjs';
const { USER_SITE } = await import('./src/consts.ts');
// https://astro.build/config
export default defineConfig({
site: USER_SITE,
output: 'static',
style: {
scss: {
includePaths: ["./src/styles"],
},
},
integrations: [mdx(),
icon({
include: {
mdi: ["*"], // (Default) Loads entire Material Design Icon set
},
}),
swup({
cache: true,
progress: true,
accessibility: true,
smoothScrolling: true,
preload: {
hover: true,
visible: false
},
// theme: 'slide',
containers: ["#swup"],
}), terser({
compress: true,
mangle: true,
}), sitemap(), tailwind(), pagefind(), astroI18next(), playformCompress()],
markdown: {
shikiConfig: {
themes: {
light: CODE_THEME.light,
dark: CODE_THEME.dark,
},
transformers: transformers
},
remarkPlugins: [remarkMath, remarkAddAnchor, remarkReadingTime],
rehypePlugins: [rehypeKatex, rehypeFadeInUp,
[
rehypeExternalLinks,
{
content: {
type: 'element',
tagName: 'svg',
properties: {
width: '1em',
height: '1em',
viewBox: '0 0 24 24',
fill: 'none',
xmlns: 'http://www.w3.org/2000/svg'
},
children: [
{
type: 'element',
tagName: 'g',
properties: {
id: 'SVGRepo_bgCarrier',
'stroke-width': '0'
},
children: []
},
{
type: 'element',
tagName: 'g',
properties: {
id: 'SVGRepo_tracerCarrier',
'stroke-linecap': 'round',
'stroke-linejoin': 'round'
},
children: []
},
{
type: 'element',
tagName: 'g',
properties: {
id: 'SVGRepo_iconCarrier'
},
children: [
{
type: 'element',
tagName: 'g',
properties: {
id: 'SVGRepo_iconCarrier'
},
children: [
{
type: 'element',
tagName: 'path',
properties: {
d: 'M10.0002 5H8.2002C7.08009 5 6.51962 5 6.0918 5.21799C5.71547 5.40973 5.40973 5.71547 5.21799 6.0918C5 6.51962 5 7.08009 5 8.2002V15.8002C5 16.9203 5 17.4801 5.21799 17.9079C5.40973 18.2842 5.71547 18.5905 6.0918 18.7822C6.5192 19 7.07899 19 8.19691 19H15.8031C16.921 19 17.48 19 17.9074 18.7822C18.2837 18.5905 18.5905 18.2839 18.7822 17.9076C19 17.4802 19 16.921 19 15.8031V14M20 9V4M20 4H15M20 4L13 11',
stroke: '#888',
'stroke-width': '2',
'stroke-linecap': 'round',
'stroke-linejoin': 'round'
},
children: []
}
]
}
]
}
]
}
}
]],
},
vite: {
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
},
});