-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathastro.config.mjs
More file actions
193 lines (190 loc) · 5.62 KB
/
astro.config.mjs
File metadata and controls
193 lines (190 loc) · 5.62 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
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
// @ts-check
import partytown from "@astrojs/partytown";
import react from "@astrojs/react";
import starlight from "@astrojs/starlight";
// @ts-ignore
import remarkMermaid from "@southball/remark-mermaid";
import compress from "astro-compress";
import metaTags from "astro-meta-tags";
import { defineConfig } from "astro/config";
import rehypeExternalLinks from "rehype-external-links";
import { remarkSandpack } from "remark-sandpack";
// @ts-ignore
import wikiLinkPlugin from "remark-wiki-link-plus";
import starlightScrollToTop from "starlight-scroll-to-top";
import starlightSidebarTopics from "starlight-sidebar-topics";
import AutoImportAstro from "unplugin-auto-import/astro";
import AutoImport from "unplugin-auto-import/vite";
import IconsResolver from "unplugin-icons/resolver";
import Icons from "unplugin-icons/vite";
// https://astro.build/config
export default defineConfig({
integrations: [
metaTags(),
compress({
HTML: false,
CSS: false,
}),
partytown({
config: {
forward: ["dataLayer.push"],
},
}),
starlight({
title: "SysLearn",
description: "シス研として習得してほしいスキルを学ぶ蔵",
defaultLocale: "ja",
locales: {
root: {
label: "日本語",
lang: "ja",
},
},
tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 4 },
logo: {
src: "./src/assets/icons/logo/sym.svg",
},
social: [
{ icon: "github", label: "GitHub", href: "https://github.com/SystemEngineeringTeam/SysLearn" },
{ icon: "x.com", label: "X", href: "https://x.com/set_official" },
{ icon: "instagram", label: "Instagram", href: "https://www.instagram.com/ait.sysken" },
],
components: {
Footer: "src/components/starlight/Footer.astro",
PageTitle: "src/components/starlight/PageTitle.astro",
},
customCss: [
"@fontsource-variable/inter",
"@fontsource-variable/noto-sans-jp",
"src/styles/global.css",
"src/styles/fonts.css",
],
plugins: [
starlightSidebarTopics([
{
label: "ホーム",
link: "/",
icon: "rocket",
items: [
{
label: "はじめに",
link: "/",
},
{
label: "執筆者向け",
autogenerate: { directory: "for-writers/" },
},
{
label: "環境構築ガイド集",
autogenerate: { directory: "setups/" },
},
],
},
// {
// label: "C言語",
// link: "/textbook/c-lang/beginner/setup",
// icon: "document",
// items: [
// {
// label: "基礎コース",
// autogenerate: { directory: "textbook/c-lang/beginner" },
// },
// ],
// },
{
label: "Web",
link: "/textbook/web/for-classes/html-structure-basic",
icon: "document",
items: [
{
label: "授業ついていくもんコース",
autogenerate: { directory: "textbook/web/for-classes" },
},
{
label: "ハッカソン出れるもんコース",
autogenerate: { directory: "textbook/web/for-hackathons" },
},
],
},
{
label: "Android",
link: "/textbook/android",
icon: "seti:kotlin",
items: [
{
label: "Androidアプリ開発入門",
autogenerate: { directory: "textbook/android" },
},
],
},
{
label: "ゲーム制作",
link: "/textbook/game/unity/tutorial",
icon: "puzzle",
items: [
{
label: "Unity で玉転がしゲーム作るコース",
autogenerate: { directory: "textbook/game/unity" },
},
],
},
]),
starlightScrollToTop({
threshold: 500,
// ref: https://icones.js.org/collection/material-symbols?s=up&variant=Regular&icon=material-symbols:arrow-upward
svgPath: "M11 20V7.825l-5.6 5.6L4 12l8-8l8 8l-1.4 1.425l-5.6-5.6V20z",
}),
],
}),
react(),
AutoImportAstro({
resolvers: [
IconsResolver({
prefix: "Icon",
extension: "jsx",
}),
],
}),
],
site: "https://learn.sysken.net",
image: {
remotePatterns: [{ protocol: "https" }, { protocol: "http" }],
},
markdown: {
remarkPlugins: [
[remarkMermaid, { themes: ["dark", "neutral"] }],
[wikiLinkPlugin, { markdownFolder: "src/content/docs" }],
// @ts-expect-error
remarkSandpack,
],
rehypePlugins: [
[
rehypeExternalLinks,
{
target: "_blank",
rel: ["noopener", "noreferrer"],
content: { type: "text", value: " ↗" },
},
],
],
},
vite: {
plugins: [
// NOTE: インポートなしにアイコンを使用できるようにするための設定
// ref: https://github.com/unplugin/unplugin-icons/blob/3831eb07d96e94d503df62f45512f3ca3e50cc26/README.md#auto-importing
AutoImport({
resolvers: [
IconsResolver({
prefix: "Icon",
extension: "jsx",
}),
],
}),
Icons({
autoInstall: true,
compiler: "jsx",
jsx: "react",
}),
],
},
});