From bb74335a2fc1b0697c2b7088b010484ade784519 Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Thu, 5 Nov 2026 13:30:26 +0900 Subject: events: 月別アーカイブページを追加 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - /kodaira-data/events/YYYY-MM/ をデータから自動生成(2026年10月〜2027年3月の6か月分) - 会議とイベントを月ごとに表示し、前月・翌月のリンクを設置 - 行事予定ページ下部に月別アーカイブのリンクを追加 - 日付計算を共通モジュール化し、カレンダーと生成ページで同じ結果になるようにした --- src/pages/kodaira-data/events/[month].astro | 72 +++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/pages/kodaira-data/events/[month].astro (limited to 'src/pages/kodaira-data') diff --git a/src/pages/kodaira-data/events/[month].astro b/src/pages/kodaira-data/events/[month].astro new file mode 100644 index 0000000..1969cee --- /dev/null +++ b/src/pages/kodaira-data/events/[month].astro @@ -0,0 +1,72 @@ +--- +// 月別アーカイブ(/kodaira-data/events/2026-11/ など)。 +// 行事予定のデータ(src/data/schedule/*.json)から、その月の予定だけを静的に生成する。 +import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; +import ScheduleTable from '@/components/ScheduleTable.astro'; +import { monthKeys, monthLabel, rowsInMonth } from '@/lib/schedule-months'; +import { SCHEDULE_BASE_PATH } from '@/data/schedule/config'; + +export function getStaticPaths() { + return monthKeys.map((month, i) => ({ + params: { month }, + props: { + month, + prev: monthKeys[i - 1] ?? null, + next: monthKeys[i + 1] ?? null, + }, + })); +} + +const { month, prev, next } = Astro.props as { + month: string; + prev: string | null; + next: string | null; +}; + +const label = monthLabel(month); +const meetingRows = rowsInMonth(month, 'meeting'); +const eventRows = rowsInMonth(month, 'event'); + +const url = (key: string) => `${SCHEDULE_BASE_PATH}${key}/`; +--- + + +

← 小平市のイベント・行事予定カレンダー(今後)に戻る

+ +

+ {label}の小平市のイベントと、審議会等・市議会の開催予定です。開催日が過ぎたものも記録として掲載しています。 + 変更になることがありますので、各問い合わせ先へご確認ください。 +

+ + { + meetingRows.length > 0 && ( + <> +

審議会等・市議会の開催予定

+
+ +
+ + ) + } + + { + eventRows.length > 0 && ( + <> +

イベント

+
+ +
+ + ) + } + + +
-- cgit v1.3.1