Skip to content

Commit 77cb8f2

Browse files
committed
feat: timetableのスキーマを追加
1 parent f588aba commit 77cb8f2

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

2025/src/content/config.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { glob } from "astro/loaders";
2-
// src/content/config.ts
1+
import { file, glob } from "astro/loaders";
32
import { defineCollection, z } from "astro:content";
43

54
const sponsors = defineCollection({
@@ -15,7 +14,20 @@ const sponsors = defineCollection({
1514
}),
1615
});
1716

18-
// コレクションのエクスポート
17+
const timetable = defineCollection({
18+
loader: file("./src/content/timetable.toml"),
19+
schema: z.array(
20+
z.object({
21+
title: z.string(),
22+
start_at: z.coerce.date(),
23+
end_at: z.coerce.date(),
24+
speaker_name: z.string().optional(),
25+
session_id: z.string().optional(),
26+
}),
27+
),
28+
});
29+
1930
export const collections = {
2031
sponsors,
32+
timetable,
2133
};

0 commit comments

Comments
 (0)