Skip to content

Commit de8bb26

Browse files
committed
feat: frontmatter のチェック (slug, sidebarOrder, next) を実装
1 parent 4344de4 commit de8bb26

14 files changed

Lines changed: 650 additions & 60 deletions

File tree

.cspell.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"Elems",
1515
"figcaption",
1616
"fontsource",
17+
"frontmatter",
18+
"Frontmatter",
1719
"github",
1820
"gtag",
1921
"hackathon",
@@ -27,6 +29,8 @@
2729
"pandacss",
2830
"partytown",
2931
"rgba",
32+
"syscat",
33+
"Syscat",
3034
"sysken",
3135
"syslearn"
3236
]

astro.config.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
// @ts-check
2+
13
import partytown from "@astrojs/partytown";
24
import react from "@astrojs/react";
35
import starlight from "@astrojs/starlight";
6+
// @ts-ignore
47
import remarkMermaid from "@southball/remark-mermaid";
58
import compress from "astro-compress";
69
import metaTags from "astro-meta-tags";
710
import { defineConfig } from "astro/config";
11+
import rehypeExternalLinks from "rehype-external-links";
12+
// @ts-ignore
813
import wikiLinkPlugin from "remark-wiki-link-plus";
914
import starlightSidebarTopics from "starlight-sidebar-topics";
1015
import Icons from "unplugin-icons/vite";
@@ -69,7 +74,7 @@ export default defineConfig({
6974
},
7075
{
7176
label: "C言語",
72-
link: "/textbook/c-lang/beginner/01--setup",
77+
link: "/textbook/c-lang/beginner/setup",
7378
icon: "document",
7479
items: [
7580
{
@@ -80,7 +85,7 @@ export default defineConfig({
8085
},
8186
{
8287
label: "Web",
83-
link: "/textbook/web",
88+
link: "/textbook/web/for-classes",
8489
icon: "document",
8590
items: [
8691
{

bun.lock

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

bun.lockb

-554 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"nanostores": "^1.0.1",
3939
"react": "^19.1.0",
4040
"react-dom": "^19.1.0",
41+
"rehype-external-links": "^3.0.0",
4142
"remark-wiki-link-plus": "^1.1.1",
4243
"sharp": "^0.34.2",
4344
"starlight-sidebar-topics": "^0.6.0"
-136 KB
Binary file not shown.

src/components/SyscatComment.astro

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,13 @@
11
---
22
import { Image } from "astro:assets";
3+
import { SYSCAT } from "@/lib/utils/syscat";
34
4-
// ref: https://sysken.esa.io/posts/841
5-
const SYSCAT = {
6-
DEFAULT:
7-
"https://img.esa.io/uploads/production/attachments/19973/2024/02/14/138598/35cad701-0542-471f-b4ce-a09678edb673.PNG",
8-
/// チラッ
9-
EYES:
10-
"https://img.esa.io/uploads/production/attachments/19973/2024/06/06/138598/92239f09-18e6-4f48-854c-feaaa999f59b.PNG",
11-
/// わ~い!
12-
RAISEDHANDS:
13-
"https://img.esa.io/uploads/production/attachments/19973/2023/11/30/138598/d254a365-33e6-4ee3-8caf-4c20df402264.PNG",
14-
/// キラキラ :syscat-kirakira:
15-
SPARKLES:
16-
"https://img.esa.io/uploads/production/attachments/19973/2024/01/11/138598/d24414af-e785-4f6d-98cc-25685bc1f2e9.png",
17-
/// ドヤッ :syscat-doyaru:
18-
BRAGGING:
19-
"https://img.esa.io/uploads/production/attachments/19973/2024/03/06/138598/b74322eb-4eb6-4390-acfd-757233c1edf7.PNG",
20-
/// キュン :syscat_love:
21-
LOVE:
22-
"https://img.esa.io/uploads/production/attachments/19973/2024/02/06/138598/4857664f-5d49-4c5a-9f32-f2656045a5d7.PNG",
23-
/// これ!
24-
HERE:
25-
"https://img.esa.io/uploads/production/attachments/19973/2024/02/07/138598/c37aee0f-f8eb-47ce-81a3-2f9877769ec3.PNG",
26-
/// すやすや
27-
SLEEPING:
28-
"https://img.esa.io/uploads/production/attachments/19973/2024/02/14/138598/53e27e1f-9ccc-4e35-b92e-1da8c773fa38.PNG",
29-
/// グッ :syscat_ok:
30-
OK:
31-
"https://img.esa.io/uploads/production/attachments/19973/2024/06/06/138598/317b8911-8ad0-48ae-81d1-659e3ca90924.PNG",
32-
/// うわ~ん :syscat_cry:
33-
CRYING:
34-
"https://img.esa.io/uploads/production/attachments/19973/2024/06/06/138598/2c5bfd4f-8c07-41ef-8975-64a5109ef804.PNG",
35-
/// う~ん?
36-
CONFUSED:
37-
"https://img.esa.io/uploads/production/attachments/19973/2024/04/09/138598/8834cd16-2cfb-491d-aab9-bd273517355a.PNG",
38-
/// チラチラ
39-
PEEKING:
40-
"https://img.esa.io/uploads/production/attachments/19973/2024/04/09/138598/566a0b54-f603-4d42-b755-8287f17e6e2c.PNG",
41-
/// えっ :syscat_human:
42-
HUMAN:
43-
"https://img.esa.io/uploads/production/attachments/19973/2024/04/17/138598/add0a929-1711-4f32-b29f-14b310a0831e.PNG",
44-
/// ぱ~ん! :syscat_medetai:
45-
TADA:
46-
"https://img.esa.io/uploads/production/attachments/19973/2024/05/06/138598/cf2ce79a-3dfe-4041-bcf7-08ba3d866380.PNG",
47-
/// ストン
48-
SITTING:
49-
"https://img.esa.io/uploads/production/attachments/19973/2024/05/09/138598/5d9cf28b-685e-43ac-a197-d294dfd249f8.PNG",
50-
/// びっくり :syscat_bikkuri:
51-
SURPRISED:
52-
"https://img.esa.io/uploads/production/attachments/19973/2024/06/06/138598/ff9f29a8-f572-47b2-aa5b-f9df8ff86014.PNG",
53-
} as const;
545
556
type Props = {
567
type?: keyof typeof SYSCAT;
578
};
589
5910
const { type } = Astro.props as Props;
60-
6111
---
6212

6313
<div class="syscat-comment">

src/components/starlight/Footer.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
import type { ComponentProps } from "react";
33
import { ReadTextbookBadge } from "@/components/ReadTextbookBadge";
44
import Default from "@astrojs/starlight/components/Footer.astro";
5+
import { getCollection } from 'astro:content';
6+
import { checkFrontmatterOrThrow } from "@/lib/utils/frontmatter";
57
68
const { id } = Astro.locals.starlightRoute.entry;
79
const isInTextbook = id.startsWith("textbook/");
810
const textbookId = isInTextbook ? id.replace("textbook/", "") : undefined;
911
12+
const collections = await getCollection("docs");
13+
checkFrontmatterOrThrow(collections);
14+
1015
type Props = ComponentProps<typeof Default>;
1116
---
1217

src/content/docs/index.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
title: SysLearn
33
hero:
44
image:
5-
file: ../../assets/icons/logo/Sysnyan2.webp
5+
file: https://img.esa.io/uploads/production/attachments/19973/2024/02/14/138598/35cad701-0542-471f-b4ce-a09678edb673.PNG
66
tableOfContents: false
77
next: false
88
prev: false
99
---
1010
import { Card, CardGrid } from '@astrojs/starlight/components';
11-
import LinkList from '../../components/astro/LinkList.astro';
12-
13-
11+
import LinkList from '@/components/astro/LinkList.astro';
1412

1513
## コース一覧
1614

1715
<LinkList />
16+

0 commit comments

Comments
 (0)