Repository navigation
Expand file tree
/
Copy pathastro.config.ts
More file actions
83 lines (82 loc) · 2.22 KB
/
Copy pathastro.config.ts
File metadata and controls
83 lines (82 loc) · 2.22 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
76
77
78
79
80
81
82
83
import { defineConfig, envField, svgoOptimizer } from "astro/config";
import tailwindcss from "@tailwindcss/vite";
import mdx from "@astrojs/mdx";
import sitemap from "@astrojs/sitemap";
import { unified } from "@astrojs/markdown-remark";
import remarkToc from "remark-toc";
import remarkCollapse from "remark-collapse";
import rehypeCallouts from "rehype-callouts";
import {
transformerNotationDiff,
transformerNotationHighlight,
transformerNotationWordHighlight,
} from "@shikijs/transformers";
import { transformerFileName } from "./src/utils/transformers/fileName";
import config from "./astro-paper.config";
export default defineConfig({
site: config.site.url,
integrations: [
mdx(),
sitemap({
filter: page =>
config.features?.showArchives !== false || !page.endsWith("/archives/"),
}),
],
i18n: {
locales: ["en"],
defaultLocale: "en",
routing: {
prefixDefaultLocale: false,
},
},
markdown: {
processor: unified({
remarkPlugins: [
remarkToc,
[remarkCollapse, { test: "Table of contents" }],
],
rehypePlugins: [rehypeCallouts],
}),
shikiConfig: {
themes: { light: "min-light", dark: "night-owl" },
defaultColor: false,
wrap: false,
transformers: [
transformerFileName({ style: "v2", hideDot: false }),
transformerNotationHighlight(),
transformerNotationWordHighlight(),
transformerNotationDiff({ matchAlgorithm: "v3" }),
],
},
},
vite: {
plugins: [tailwindcss()],
},
// 字体配置 - 由于Google Fonts在国内无法访问,暂时注释掉
// 如需要可取消注释或使用本地字体
/* fonts: [
{
name: "Google Sans Code",
cssVariable: "--font-google-sans-code",
provider: fontProviders.google({
// 可在此添加代理配置
}),
fallbacks: ["monospace"],
weights: [300, 400, 500, 600, 700],
styles: ["normal", "italic"],
formats: ["woff", "ttf"],
},
], */
env: {
schema: {
PUBLIC_GOOGLE_SITE_VERIFICATION: envField.string({
access: "public",
context: "client",
optional: true,
}),
},
},
experimental: {
svgOptimizer: svgoOptimizer(),
},
});