Add /changelog page that auto-syncs with GitHub Releases#36
Merged
Conversation
A new top-level /changelog route fetches every release of netclaw-dev/netclaw at build time, sorts newest-first, renders the release-note markdown via marked, and styles the result to match the landing page (dark theme, JetBrains Mono tags, purple Pre-release badge). Optional GH_TOKEN env var lifts the unauthenticated API rate limit on shared build infra. A failed fetch leaves a single 'view on GitHub' card instead of breaking the build. Nav links to /changelog added to the landing-page desktop and mobile menus. ops/auto-rebuild-on-release/ ships a workflow template + README for the netclaw repo: a release: published event pings a Cloudflare Pages deploy hook, the site rebuilds, the changelog reflects the new release within a couple of minutes.
The landing-page and changelog navbars were drifting because each page
hand-rolled its own copy of the nav markup and CSS. Extract everything
into a single SiteNav component used by both the landing page
(currentPage='home') and the new ChangelogLayout (currentPage='changelog'),
so the chrome stays identical by construction.
While auditing the logo, the public copy of netclaw-icon-purple.svg was
found to contain a stray <rect fill='white'/> that was rendering a hard
white square behind the icon on the changelog page. Remove it — both
on-disk copies are now byte-identical.
Reshape the changelog into Stripe/Linear-style per-release pages:
/changelog latest release in full, canonical to /changelog/<tag>
/changelog/<tag> every release on its own URL (56 generated pages),
with prev/next pager links
A new ChangelogSidebar lists every version with the active one
highlighted, sticky on desktop and collapsible on mobile. Shared
src/lib/releases.js caches the GitHub Releases fetch at module level so
the API is only hit once per build regardless of which routes consume it.
ChangelogLayout owns the shared page chrome (head, header, two-column
grid, footer) and accepts a single release as a prop plus a slot for the
pager — index and [tag] are thin and almost identical.
Extract ReleasePager into its own component and move the prev/next derivation into ChangelogLayout, which now calls getReleases() itself (the module cache makes it free). Page files lose the releases, fetchError, newer, and older props plus the slot='pager' indirection and the <span /> filler placeholder; both are now thin SEO/identity wrappers around the layout. Drop the redundant release.name !== release.rawTag check in [tag].astro — releases.js already filters that case to null. Lock the date formatters in releases.js to timeZone: 'UTC' so a build running locally (e.g. America/New_York) renders the same date as a Cloudflare Pages build (always UTC). SiteNav: drop the unused 'home' currentPage value (no link was ever wired to it), dedupe the desktop/mobile link lists through a single links array, add width/height attributes to the logo img to kill the Lighthouse CLS warning, and document the hex-literal palette choice inline. ChangelogSidebar: fix cursor: default on the summary — the <details> actually is clickable on desktop too, the cursor was lying.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
/changelogpage that auto-syncs with GitHub Releases — every release ofnetclaw-dev/netclawgets its own page at/changelog/<tag>, with a sticky sidebar listing all versions. Latest release renders at/changelog. Pulled in at build time from the GitHub API, so no client-side flicker and no rate-limit risk per visitor.Also extracts a shared
SiteNavcomponent so the landing-page and changelog navbars stay identical by construction, and fixes a stray<rect fill="white"/>inpublic/assets/netclaw-icon-purple.svgthat was rendering a white square behind the icon on dark backgrounds.Pages
/changelog/changelog/<latest-tag>)/changelog/<tag>Both share
ChangelogLayout,ChangelogSidebar, and aReleasePagercomponent. The sidebar lists every version, sticky on desktop and collapsible on mobile.New files
src/lib/releases.js— module-cached GitHub Releases fetchsrc/layouts/ChangelogLayout.astro— shared page chromesrc/components/SiteNav.astro— extracted fromindex.astrosrc/components/ChangelogSidebar.astrosrc/components/ReleasePager.astrosrc/pages/changelog/[tag].astro— dynamic routeops/auto-rebuild-on-release/— GitHub Action template (for the netclaw repo) that triggers a Cloudflare Pages deploy hook on every releaseLogo fix
public/assets/netclaw-icon-purple.svghad<rect width="2048" height="2048" fill="white"/>as its first child;src/assets/netclaw-icon-purple.svgdid not. Same filename, drifted contents. The white rect rendered as a hard square behind the icon on the changelog page (which loaded the public copy). Removed it; both copies are now byte-identical.Followups (separate PRs)
ops/auto-rebuild-on-release/README.md(Cloudflare Pages → Deploy Hooks; addWEBSITE_DEPLOY_HOOKsecret tonetclaw-dev/netclaw; drop the workflow file in).markedfor@astrojs/markdown-remarkto unify markdown rendering across docs and release notes (would enable mermaid in release bodies for free).BaseLayoutso the GA snippet, fonts, favicons, and footer stop being duplicated betweenindex.astroandChangelogLayout.astro.Verification
npm run buildpasses — 112 pages built (was 55 before this branch)./,/changelog,/changelog/0.19.0,/changelog/0.18.2— all 200, content correct, navbars identical between landing and changelog (sameSiteNavcomponent instance).