-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
astro.config.mjs
65 lines (63 loc) · 1.66 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
import { defineConfig } from 'astro/config';
import rehypeMermaid from 'rehype-mermaid';
import { rehypeShiki } from '@astrojs/markdown-remark';
import sitemap from '@astrojs/sitemap';
import mdx from '@astrojs/mdx';
import icon from "astro-icon";
import remarkCustomHeaderId from 'remark-custom-header-id';
import { i18n, filterSitemapByDefaultLocale } from "astro-i18n-aut/integration";
export const defaultLocale = 'en';
export const locales = Object.freeze({
ar: 'ar',
de: 'de',
en: 'en',
es: 'es',
fr: 'fr',
it: 'it',
ko: 'ko',
ja: 'ja',
nl: 'nl',
'pt-br': 'pt-BR',
'pt-pt': 'pt-PT',
zh: 'zh-Hans',
// Astro doesn't maintain the case when generating file-based slugs, so we need to use the
// lowercase version of the locale code as the key.
// See: https://github.com/withastro/roadmap/pull/373#issuecomment-1332459000
// See: https://github.com/withastro/roadmap/discussions/516
'zh-hant': 'zh-Hant',
});
// https://astro.build/config
export default defineConfig({
site: 'https://auth.wiki',
build: {
format: 'file',
},
trailingSlash: 'never',
markdown: {
rehypePlugins: [
[rehypeMermaid, { dark: true, strategy: 'img-svg' }],
[rehypeShiki, { themes: { light: 'one-light', dark: 'one-dark-pro' } }]
],
remarkPlugins: [remarkCustomHeaderId],
remarkRehype: {
footnoteLabelTagName: 'span',
},
syntaxHighlight: false
},
integrations: [
i18n({
locales,
defaultLocale,
exclude: ['pages/**/*.ts']
}),
mdx(),
sitemap({
i18n: {
locales,
defaultLocale,
},
filter: filterSitemapByDefaultLocale({ defaultLocale }),
}),
icon()
]
});