-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.ts
More file actions
75 lines (74 loc) · 2.14 KB
/
Copy pathastro.config.ts
File metadata and controls
75 lines (74 loc) · 2.14 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
65
66
67
68
69
70
71
72
73
74
75
import { defineConfig } from "astro/config";
import unpluginFavicons from "@anolilab/unplugin-favicons/vite";
import { unified } from "@astrojs/markdown-remark";
import { C } from "./src/site.config";
import mdx from "@astrojs/mdx";
import rehypeSlug from "rehype-slug";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import { remarkGitInfo } from "./src/remark/remark-git-info";
import { remarkExcerpt } from "./src/remark/remark-excerpt";
import search from "./src/integrations/search";
import sitemap from "@astrojs/sitemap";
import Icons from "unplugin-icons/vite";
import nanostoresI18n from "astro-nanostores-i18n";
import deCH from "./src/translations/de-CH.json";
import deCHExt from "./src/translations/de-CH.ext.json";
import enUS from "./src/translations/en-US.json";
import enUSExt from "./src/translations/en-US.ext.json";
export default defineConfig({
prefetch: true,
build: {
format: "file",
},
i18n: {
defaultLocale: C.DEFAULT_LOCALE,
locales: Object.keys(C.LOCALES),
},
markdown: {
shikiConfig: {
themes: {
light: "github-light",
dark: "github-dark",
},
},
processor: unified({
remarkPlugins: [
[remarkExcerpt, { length: C.SETTINGS.BLOG.EXCERPT_LENGTH }],
[remarkGitInfo, { remoteUrlBase: C.SETTINGS.REMOTE.BASE_URL }],
],
rehypePlugins: [rehypeSlug, [rehypeAutolinkHeadings, { behavior: "wrap" }]],
}),
},
vite: {
plugins: [
unpluginFavicons({
logo: "res/brand/icon.png",
inject: true,
favicons: {
theme_color: C.SETTINGS.BROWSER.THEME_COLOR,
icons: {
android: true,
appleIcon: true,
favicons: true,
windows: true,
yandex: true,
appleStartup: false,
},
},
}),
Icons({ compiler: "astro" }),
],
},
integrations: [
search(),
mdx(),
sitemap({ i18n: { defaultLocale: C.DEFAULT_LOCALE, locales: C.LOCALES } }),
nanostoresI18n({
translations: {
de: { ...deCH, ...deCHExt },
en: { ...enUS, ...enUSExt },
},
addMiddleware: true,
}),
],
});