-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
116 lines (111 loc) · 3.48 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import starlightImageZoom from "starlight-image-zoom";
const deployUrlMap = {
github: "https://mr-xzq.github.io/notes/",
vercel: "https://notes-z8e7-xzqs-projects-02c17255.vercel.app",
};
const deployBase2Site = {
// vercel or other
"/": deployUrlMap.vercel,
// github pages, because it must contain subpath
"/notes/": deployUrlMap.github,
};
const currentSite =
deployBase2Site[process.env.DEPLOY_BASE] || deployUrlMap.github;
const currentBase = process.env.DEPLOY_BASE ?? "/";
// console.log({
// currentSite,
// DEPLOY_BASE: process.env.DEPLOY_BASE,
// });
// https://astro.build/config
export default defineConfig({
site: currentSite,
base: currentBase,
integrations: [
starlight({
plugins: [starlightImageZoom()],
title: "Xzq Notes",
social: {
github: "https://github.com/Mr-xzq/notes",
},
logo: {
// src: "./src/assets/hero-logo.svg",
src: "/public/logo.svg",
},
components: {
Hero: "@/components/Hero.astro",
},
favicon: "/logo.svg",
sidebar: [
{
label: "基础",
items: [
{ label: "事件循环", slug: "basic/event-loop" },
{
label: "浏览器的进程与线程",
slug: "basic/browser-process-and-thread",
},
{ label: "简述 JS 异步发展不同阶段", slug: "basic/async-history" },
{ label: "ES6 - Generator", slug: "basic/generator" },
{ label: "ES6 - Proxy", slug: "basic/proxy" },
{ label: "ES6 - Reflect", slug: "basic/reflect" },
{ label: "JS 位运算", slug: "basic/bit-operation" },
{ label: "JS 正则表达式", slug: "basic/regular-expression" },
{ label: "Object 常见 Api", slug: "basic/object-api" },
{
label: "遍历对象属性常用方法",
slug: "basic/traverse-object-property",
},
{
label: "转化为数字类型的常用方法",
slug: "basic/convert2-number",
},
{ label: "原型链", slug: "basic/prototype-chain" },
{ label: "继承", slug: "basic/inherit" },
{
label: "作用域(链),执行期上下文(栈),变量提升,闭包",
slug: "basic/scope-chain",
},
{ label: "深入 this", slug: "basic/this" },
{ label: "运算符优先级", slug: "basic/operator-priority" },
],
},
{
label: "工程化",
items: [
{
label: "如何统一代码规范",
slug: "engineering/code-lint-and-format",
},
],
},
{
label: "TypeScript",
items: [
{
label: "基础",
slug: "ts-learn/basic",
},
],
},
{
label: "Vue",
items: [
{ label: "深入理解响应式", slug: "vue-learn/reactive" },
{
label: "深入 render-mount-patch 流程",
slug: "vue-learn/render-h-mount-patch",
},
{ label: "深入异步更新", slug: "vue-learn/async-update" },
],
},
],
lastUpdated: true,
editLink: {
baseUrl: "https://github.com/Mr-xzq/notes/edit/master/",
},
pagination: true,
}),
],
});