aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ScheduleMonthLinks.astro32
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>
))
}