--- import updates from "../data/updates.json"; type Update = { date: string; title: string; url: string; group: string }; const initial = Number(Astro.props.limit ?? 5); const step = Number(Astro.props.step ?? 10); const items = updates as Update[]; /** ISO の日付(YYYY-MM-DD)を「令和8年9月20日」の形にする */ function toJapaneseDate(iso: string): string { const [y, m, d] = iso.split("-").map(Number); let era = "昭和"; let n = y - 1925; if (y >= 2019 && !(y === 2019 && m <= 4)) { era = "令和"; n = y - 2018; } else if (y >= 1989) { era = "平成"; n = y - 1988; } return `${n === 1 ? `${era}元年` : `${era}${n}年`}${m}月${d}日`; } --- { items.length > initial && ( ) }