diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-11-05 13:40:32 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-11-05 13:40:32 +0900 |
| commit | ff9bafe77a5e0dd84b613bb2aae0bf2a9cb84359 (patch) | |
| tree | e86e638f80f94f42e67253eb27f0a8d36f4fe2d8 /src/components/ScheduleMonthLinks.astro | |
| parent | 881485f010d6d576bab958548e3c955b8067dd34 (diff) | |
events: 年度別アーカイブとRSSフィードを追加
月別ページに加えて、4月〜翌3月の年度ページ(/kodaira/events/r8/)を
追加した。月別リンクは年度ごとにまとめ、今後の予定はfeed.xmlで
配信する。
Diffstat (limited to 'src/components/ScheduleMonthLinks.astro')
| -rw-r--r-- | src/components/ScheduleMonthLinks.astro | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/components/ScheduleMonthLinks.astro b/src/components/ScheduleMonthLinks.astro index 8628998..9f553df 100644 --- a/src/components/ScheduleMonthLinks.astro +++ b/src/components/ScheduleMonthLinks.astro @@ -1,15 +1,35 @@ --- -// 月別アーカイブのリンク一覧。行事予定ページの下部に置く。 -import { monthCounts, monthKeys, monthLabel } from '@/lib/schedule-months'; +// 月別・年度別アーカイブのリンク一覧。行事予定ページの下部に置く。 +import { + fiscalYearKeys, + fiscalYearLabel, + fiscalYearOf, + monthCounts, + monthKeys, + monthLabel, +} from '@/lib/schedule-months'; import { scheduleUrl } from '@/data/schedule/config'; + +const groups = fiscalYearKeys.map((fy) => ({ + key: fy, + label: fiscalYearLabel(fy), + months: monthKeys.filter((month) => fiscalYearOf(month) === fy), +})); --- <ul class="schedule-month-archive"> { - monthKeys.map((key) => ( - <li> - <a href={scheduleUrl(`${key}/`)}>{monthLabel(key)}の予定</a> - <span class="schedule-month-count">{monthCounts[key]}件</span> + groups.map((group) => ( + <li class="schedule-year-archive"> + <a href={scheduleUrl(`${group.key}/`)}>{group.label}の予定</a> + <ul> + {group.months.map((key) => ( + <li> + <a href={scheduleUrl(`${key}/`)}>{monthLabel(key)}の予定</a> + <span class="schedule-month-count">{monthCounts[key]}件</span> + </li> + ))} + </ul> </li> )) } |
