Skip to content

Commit cfe99cf

Browse files
committed
feat: サイドバーを starlight-sidebar-topics に移行
1 parent 9816022 commit cfe99cf

7 files changed

Lines changed: 89 additions & 162 deletions

File tree

astro.config.mjs

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import compress from "astro-compress";
66
import metaTags from "astro-meta-tags";
77
import { defineConfig } from "astro/config";
88
import wikiLinkPlugin from "remark-wiki-link-plus";
9+
import starlightSidebarTopics from "starlight-sidebar-topics";
910
import Icons from "unplugin-icons/vite";
1011

1112
// https://astro.build/config
@@ -44,7 +45,6 @@ export default defineConfig({
4445
{ icon: "instagram", label: "Instagram", href: "https://www.instagram.com/ait.sysken" },
4546
],
4647
components: {
47-
Sidebar: "src/components/starlight/Sidebar.astro",
4848
Footer: "src/components/starlight/Footer.astro",
4949
},
5050
customCss: [
@@ -53,45 +53,51 @@ export default defineConfig({
5353
"src/styles/global.css",
5454
"src/styles/fonts.css",
5555
],
56-
57-
sidebar: [
58-
{
59-
label: "ホーム",
60-
items: [
61-
{
62-
label: "はじめに",
63-
link: "/",
64-
},
65-
{
66-
label: "困ったときは",
67-
autogenerate: { directory: "help/" },
68-
},
69-
],
70-
},
71-
{
72-
label: "C言語",
73-
items: [
74-
{
75-
label: "基礎コース",
76-
autogenerate: { directory: "textbook/c-lang/beginner" },
77-
},
78-
],
79-
},
80-
{
81-
label: "Web",
82-
items: [
83-
{
84-
label: "授業ついていくもんコース",
85-
autogenerate: { directory: "textbook/web/for-classes" },
86-
},
87-
{
88-
label: "ハッカソン出れるもんコース",
89-
autogenerate: { directory: "textbook/web/for-hackathons" },
90-
},
91-
],
92-
},
56+
plugins: [
57+
starlightSidebarTopics([
58+
{
59+
label: "ホーム",
60+
link: "/",
61+
icon: "rocket",
62+
items: [
63+
{
64+
label: "はじめに",
65+
link: "/",
66+
},
67+
{
68+
label: "困ったときは",
69+
autogenerate: { directory: "help/" },
70+
},
71+
],
72+
},
73+
{
74+
label: "C言語",
75+
link: "/textbook/c-lang/beginner/01--setup",
76+
icon: "document",
77+
items: [
78+
{
79+
label: "基礎コース",
80+
autogenerate: { directory: "textbook/c-lang/beginner" },
81+
},
82+
],
83+
},
84+
{
85+
label: "Web",
86+
link: "/textbook/web",
87+
icon: "document",
88+
items: [
89+
{
90+
label: "授業ついていくもんコース",
91+
autogenerate: { directory: "textbook/web/for-classes" },
92+
},
93+
{
94+
label: "ハッカソン出れるもんコース",
95+
autogenerate: { directory: "textbook/web/for-hackathons" },
96+
},
97+
],
98+
},
99+
]),
93100
],
94-
95101
}),
96102
react(),
97103
],

bun.lock

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@SystemEngineeringTeam/SysLearn",
2+
"name": "syslearn",
33
"type": "module",
44
"version": "0.0.1",
55
"scripts": {
@@ -9,52 +9,58 @@
99
"start": "astro dev",
1010
"build": "astro build",
1111
"preview": "astro preview",
12-
"clean": "npx -y rimraf ./node_modules ./.astro ./dist",
13-
"check": "astro check && npm run tsc -b && npm run typo && npm run lint",
12+
"clean": "npx -y rimraf ./node_modules ./.astro ./dist ./generated",
13+
"check": "cmk && astro check && npm run tsc -b && npm run typo && npm run lint",
1414
"lint": "eslint",
1515
"typo": "cspell \"./src/**\" \"./scripts/**\" --gitignore"
1616
},
1717
"dependencies": {
1818
"@astrojs/check": "^0.9.4",
19-
"@astrojs/partytown": "^2.1.3",
20-
"@astrojs/react": "^4.2.0",
21-
"@astrojs/starlight": "^0.31.1",
22-
"@fontsource-variable/inter": "^5.1.1",
23-
"@fontsource-variable/noto-sans-jp": "^5.1.1",
24-
"@iconify-json/material-symbols": "^1.2.14",
19+
"@astrojs/partytown": "^2.1.4",
20+
"@astrojs/react": "^4.3.0",
21+
"@astrojs/starlight": "^0.34.4",
22+
"@fontsource-variable/inter": "^5.2.6",
23+
"@fontsource-variable/noto-sans-jp": "^5.2.6",
24+
"@iconify-json/material-symbols": "^1.2.28",
2525
"@iconify-json/mdi": "^1.2.3",
26-
"@iconify/react": "^5.2.0",
27-
"@mermaid-js/mermaid-cli": "^11.4.2",
26+
"@iconify/react": "^6.0.0",
27+
"@mermaid-js/mermaid-cli": "^11.6.0",
2828
"@nanostores/persistent": "^1.0.0",
2929
"@nanostores/react": "^1.0.0",
3030
"@southball/remark-mermaid": "^0.6.0",
31-
"@types/react": "^19.0.8",
32-
"@types/react-dom": "^19.0.3",
33-
"astro": "^5.1.5",
34-
"astro-compress": "^2.3.6",
31+
"@types/react": "^19.1.8",
32+
"@types/react-dom": "^19.1.6",
33+
"astro": "^5.11.0",
34+
"astro-compress": "^2.3.8",
3535
"astro-embed": "^0.9.0",
36-
"astro-icon": "^1.1.5",
37-
"astro-meta-tags": "^0.3.1",
36+
"astro-meta-tags": "^0.3.2",
3837
"astro-seo": "^0.8.4",
3938
"nanostores": "^1.0.1",
40-
"react": "^19.0.0",
41-
"react-dom": "^19.0.0",
39+
"react": "^19.1.0",
40+
"react-dom": "^19.1.0",
4241
"remark-wiki-link-plus": "^1.1.1",
43-
"sharp": "^0.32.5"
42+
"sharp": "^0.34.2",
43+
"starlight-sidebar-topics": "^0.6.0"
4444
},
4545
"devDependencies": {
46-
"@antfu/eslint-config": "^4.1.0",
47-
"@eslint-react/eslint-plugin": "^1.26.0",
48-
"cspell": "^8.17.3",
49-
"eslint": "^9.19.0",
50-
"eslint-config-prettier": "^10.0.1",
46+
"@antfu/eslint-config": "^4.16.2",
47+
"@css-modules-kit/codegen": "^0.4.1",
48+
"@css-modules-kit/eslint-plugin": "^0.2.1",
49+
"@eslint-react/eslint-plugin": "^1.52.2",
50+
"@iconify/json": "^2.2.354",
51+
"@svgr/core": "^8.1.0",
52+
"@svgr/plugin-jsx": "^8.1.0",
53+
"cspell": "^9.1.2",
54+
"eslint": "^9.30.1",
55+
"eslint-config-prettier": "^10.1.5",
5156
"eslint-plugin-astro": "^1.3.1",
5257
"eslint-plugin-format": "^1.0.1",
53-
"eslint-plugin-react-hooks": "^5.1.0",
54-
"eslint-plugin-react-refresh": "^0.4.18",
58+
"eslint-plugin-react-hooks": "^5.2.0",
59+
"eslint-plugin-react-refresh": "^0.4.20",
5560
"husky": "^9.1.7",
56-
"lint-staged": "^15.4.3",
57-
"typescript": "^5.7.3",
58-
"typescript-eslint": "^8.22.0"
61+
"lint-staged": "^16.1.2",
62+
"typescript": "^5.8.3",
63+
"typescript-eslint": "^8.35.1",
64+
"unplugin-icons": "^22.1.0"
5965
}
6066
}

src/components/starlight/Footer.astro

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ import type { ComponentProps } from "react";
33
import { ReadTextbookBadge } from "@/components/ReadTextbookBadge";
44
import Default from "@astrojs/starlight/components/Footer.astro";
55
6-
const { title } = Astro.locals.starlightRoute.entry.data;
7-
8-
console.log("Footer", Astro.props);
9-
10-
const isInTextbook = id?.startsWith("textbook/");
6+
const { id } = Astro.locals.starlightRoute.entry;
7+
const isInTextbook = id.startsWith("textbook/");
118
const textbookId = isInTextbook ? id.replace("textbook/", "") : undefined;
129
1310
type Props = ComponentProps<typeof Default>;

src/components/starlight/Sidebar.astro

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/components/starlight/sidebar/Tabs.astro

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/content/docs/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: SysLearn
3-
template: splash
43
hero:
54
image:
65
file: ../../assets/icons/logo/Sysnyan2.webp
6+
tableOfContents: false
77
next: false
88
prev: false
99
---

0 commit comments

Comments
 (0)