-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathastro.config.ts
More file actions
97 lines (96 loc) · 2.61 KB
/
Copy pathastro.config.ts
File metadata and controls
97 lines (96 loc) · 2.61 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import { defineConfig, envField, fontProviders } from "astro/config";
import tailwindcss from "@tailwindcss/vite";
import sitemap from "@astrojs/sitemap";
import remarkToc from "remark-toc";
import remarkCollapse from "remark-collapse";
import remarkGithubBlockquoteAlert from "remark-github-blockquote-alert";
import {
transformerNotationDiff,
transformerNotationHighlight,
transformerNotationWordHighlight,
} from "@shikijs/transformers";
import { transformerFileName } from "./src/utils/transformers/fileName";
import { transformerLangLabel } from "./src/utils/transformers/langLabel";
import { SITE } from "./src/config";
// https://astro.build/config
export default defineConfig({
site: SITE.website,
base: process.env.BASE_PATH || "/",
trailingSlash: "never",
build: {
format: "file",
},
integrations: [
sitemap({
filter: page => SITE.showArchives || !page.endsWith("/archives"),
}),
],
markdown: {
smartypants: false,
remarkPlugins: [
remarkToc,
[remarkCollapse, { test: "Table of contents" }],
remarkGithubBlockquoteAlert,
],
shikiConfig: {
// For more themes, visit https://shiki.style/themes
themes: { light: "min-light", dark: "night-owl" },
defaultColor: false,
wrap: false,
transformers: [
transformerFileName({ style: "v2", hideDot: false }),
transformerLangLabel(),
transformerNotationHighlight(),
transformerNotationWordHighlight(),
transformerNotationDiff({ matchAlgorithm: "v3" }),
],
},
},
vite: {
// eslint-disable-next-line
// @ts-ignore
// This will be fixed in Astro 6 with Vite 7 support
// See: https://github.com/withastro/astro/issues/14030
plugins: [tailwindcss()],
optimizeDeps: {
exclude: ["@resvg/resvg-js"],
},
server: {
watch: {
ignored: ["**/openspec/**", "**/hexo-backup/**"],
},
},
},
image: {
responsiveStyles: true,
layout: "constrained",
},
env: {
schema: {
PUBLIC_GOOGLE_SITE_VERIFICATION: envField.string({
access: "public",
context: "client",
optional: true,
}),
IS_PREVIEW: envField.boolean({
access: "public",
context: "server",
optional: true,
default: false,
}),
},
},
experimental: {
preserveScriptOrder: true,
fonts: [
{
name: "Google Sans Code",
cssVariable: "--font-google-sans-code",
provider: fontProviders.google(),
fallbacks: ["monospace"],
weights: [300, 400, 500, 600, 700],
styles: ["normal", "italic"],
},
],
},
});