-
Notifications
You must be signed in to change notification settings - Fork 161
/
astro.config.mjs
177 lines (176 loc) · 4.58 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import remarkMath from "remark-math";
import remarkEmoji from "remark-emoji";
import rehypeKatex from "rehype-katex";
import rehypeExternalLinks from "rehype-external-links";
// https://astro.build/config
export default defineConfig({
site: "https://njuptfreeexams.netlify.app",
vite: {
assetsInclude: ["**/*.ppt", "**/*.pptx", "**/*.doc", "**/*.docx"],
},
integrations: [
starlight({
title: "NJUPTFreeExams",
description: "南京邮电大学课程资源与复习资料共享平台",
defaultLocale: "root",
locales: {
root: {
label: "简体中文",
lang: "zh-CN",
},
},
social: {
github: "https://github.com/NJUPTFreeExams/NJUPT-General-Free-Exams",
},
customCss: ["./src/styles/custom.css"],
sidebar: [
{
label: "简介",
items: [
{
label: "组织与项目介绍",
link: "intro",
},
],
},
{
label: "指南",
items: [
{
label: "资料分类说明",
link: "guides/categories",
},
{
label: "检索与下载指南",
link: "guides/browse-and-download",
},
{
label: "上传与贡献指南",
link: "guides/upload-and-contribute",
},
{
label: "问题与建议提交指南",
link: "guides/report-issues",
},
{
label: "关于 NJUPT-General-Free-Exams 的特别说明",
link: "guides/about-general",
},
],
},
{
label: "Markdown 资料(保留目录)",
autogenerate: {
directory: "reserved",
},
},
{
label: "计算机学院",
autogenerate: {
directory: "computer-science",
},
},
{
label: "理学院",
autogenerate: {
directory: "science",
},
},
{
label: "通信与信息工程学院",
autogenerate: {
directory: "communications-and-information-engineering",
},
},
{
label: "经济学院",
autogenerate: {
directory: "economics",
},
},
{
label: "集成电路科学与工程学院",
autogenerate: {
directory: "integrated-circuit-science-and-engineering",
},
},
{
label: "管理学院",
autogenerate: {
directory: "management",
},
},
{
label: "马克思主义学院",
autogenerate: {
directory: "marxism",
},
},
{
label: "外国语学院",
autogenerate: {
directory: "foreign-languages",
},
},
{
label: "教育与技术学院",
autogenerate: {
directory: "education-and-technology",
},
},
{
label: "社会与人口学院",
autogenerate: {
directory: "sociology-and-population-studies",
},
},
{
label: "其他",
autogenerate: {
directory: "others",
},
},
],
head: [
{
tag: "link",
attrs: {
rel: "stylesheet",
href: "https://fastly.jsdelivr.net/npm/[email protected]/dist/katex.css",
defer: true,
integrity:
"sha384-WsHMgfkABRyG494OmuiNmkAOk8nhO1qE+Y6wns6v+EoNoTNxrWxYpl5ZYWFOLPCM",
crossorigin: "anonymous",
},
},
{
tag: "script",
attrs: {
"is:inline": true,
src: "https://cdn.staticfile.org/twikoo/1.6.30/twikoo.all.min.js",
},
},
],
expressiveCode: {
styleOverrides: {
borderRadius: "0.5rem",
},
},
components: {
Footer: "./src/components/Footer.astro",
MarkdownContent: "./src/components/MarkdownContent.astro",
},
editLink: {
baseUrl:
"https://github.com/NJUPTFreeExams/NJUPT-General-Free-Exams/edit/master",
},
lastUpdated: true,
}),
],
markdown: {
remarkPlugins: [remarkMath, remarkEmoji],
rehypePlugins: [rehypeKatex, [rehypeExternalLinks, { target: "_blank" }]],
},
});