-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathastro.config.mjs
77 lines (76 loc) · 2.15 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
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import { autoImportComponents } from "@serverless-cd/goat-ui/src/utils";
import tailwind from "@astrojs/tailwind";
import icon from "astro-icon";
import { SIDEBAR, SITE } from "./src/utils/config.ts";
import topLevelAwait from "vite-plugin-top-level-await";
import starlightUtils from "@lorenzo_lewis/starlight-utils";
import rehypeAstroRelativeMarkdownLinks from "astro-rehype-relative-markdown-links";
// https://astro.build/config
export default defineConfig({
site: process.env.DEPLOY_SITE || SITE.site,
base: SITE.base,
//设置处理后斜杠的策略
trailingSlash: SITE.trailingSlash,
image: {
domain: ["img.alicdn"],
},
// markdown: {
// rehypePlugins: [rehypeAstroRelativeMarkdownLinks],
// },
// trailingSlash: 'never',
integrations: [
autoImportComponents(),
starlight({
title: SITE.name,
favicon: "/favicon.png",
logo: {
light: "./public/assets/logo-black.svg",
dark: "./public/assets/logo.png",
replacesTitle: true,
},
//自定义组件
components: {
//重写主题提供组件,实现默认深色主题
ThemeProvider: "./src/components/ThemeProvider.astro",
},
disable404Route: true,
social: {
github: "https://github.com/Serverless-Devs/Serverless-Devs",
},
expressiveCode: {
themes: ["github-dark"], //TODO: 待调研
},
editLink: {
baseUrl: SITE.websiteGithubUrl,
},
//多路侧边栏设置
sidebar: SIDEBAR,
plugins: [
starlightUtils({
multiSidebar: {
switcherStyle: "hidden",
},
}),
],
}),
tailwind({ applyBaseStyles: false }),
icon({
tabler: ["book", "pencil"],
"ant-design": ["github-filled"],
basil: ["document-outline"],
}),
],
vite: {
build: {
target: "chrome68",
},
plugins: [topLevelAwait()],
},
// TODO: 梳理redirects
redirects: {
"/fc/": "docs/user-guide/aliyun/fc/readme",
"/serverless-devs/command/readme.md": "docs/user-guide/aliyun/#fc3",
},
});