diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-09-21 08:25:26 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-09-21 08:25:26 +0900 |
| commit | b3ad7c9e7d516082733930ef86b550dcdd8c66e2 (patch) | |
| tree | 39776523d81ef9d95295e9487403ff570408b03f /src/components/Updates.astro | |
| parent | f11d15bdf9839db30a9c61fc8f7ce39279ed673c (diff) | |
ホーム: git履歴から生成する更新情報を追加し、サイドバーの実績を集約
Diffstat (limited to 'src/components/Updates.astro')
| -rw-r--r-- | src/components/Updates.astro | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/components/Updates.astro b/src/components/Updates.astro new file mode 100644 index 0000000..8fbe795 --- /dev/null +++ b/src/components/Updates.astro @@ -0,0 +1,53 @@ +--- +import updates from "../data/updates.json"; + +const limit = Number(Astro.props.limit ?? 5); +const items = (updates as { date: string; title: string; url: string; group: string }[]).slice(0, limit); +--- + +<ul class="updates"> + {items.map((u) => ( + <li> + <time datetime={u.date}>{u.date.replace(/-/g, ".")}</time> + {u.group && <span class="updates-group">{u.group}</span>} + <a href={u.url}>{u.title}</a> + </li> + ))} +</ul> + +<style> + .updates { + list-style: none; + padding: 0; + margin: 0; + font-size: 0.9rem; + border-top: 1px solid var(--sl-color-gray-5); + } + .updates li { + display: flex; + flex-wrap: wrap; + align-items: baseline; + gap: 0.5rem; + padding: 0.5rem 0; + border-bottom: 1px solid var(--sl-color-gray-5); + } + .updates time { + color: var(--sl-color-gray-3); + font-variant-numeric: tabular-nums; + flex-shrink: 0; + } + .updates-group { + font-size: 0.75rem; + color: var(--sl-color-gray-2); + background: var(--sl-color-gray-6); + border-radius: 3px; + padding: 0.05rem 0.35rem; + flex-shrink: 0; + } + .updates a { + text-decoration: none; + } + .updates a:hover { + text-decoration: underline; + } +</style> |
