Skip to content

Add /changelog page that auto-syncs with GitHub Releases#36

Merged
Aaronontheweb merged 3 commits into
devfrom
feature/changelog-page
May 20, 2026
Merged

Add /changelog page that auto-syncs with GitHub Releases#36
Aaronontheweb merged 3 commits into
devfrom
feature/changelog-page

Conversation

@Aaronontheweb
Copy link
Copy Markdown
Contributor

Summary

Adds a /changelog page that auto-syncs with GitHub Releases — every release of netclaw-dev/netclaw gets 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 SiteNav component so the landing-page and changelog navbars stay identical by construction, and fixes a stray <rect fill="white"/> in public/assets/netclaw-icon-purple.svg that was rendering a white square behind the icon on dark backgrounds.

Pages

URL Renders
/changelog Latest release in full (canonical → /changelog/<latest-tag>)
/changelog/<tag> One static page per release, with prev/next pager (56 pages this build)

Both share ChangelogLayout, ChangelogSidebar, and a ReleasePager component. The sidebar lists every version, sticky on desktop and collapsible on mobile.

New files

  • src/lib/releases.js — module-cached GitHub Releases fetch
  • src/layouts/ChangelogLayout.astro — shared page chrome
  • src/components/SiteNav.astro — extracted from index.astro
  • src/components/ChangelogSidebar.astro
  • src/components/ReleasePager.astro
  • src/pages/changelog/[tag].astro — dynamic route
  • ops/auto-rebuild-on-release/ — GitHub Action template (for the netclaw repo) that triggers a Cloudflare Pages deploy hook on every release

Logo fix

public/assets/netclaw-icon-purple.svg had <rect width="2048" height="2048" fill="white"/> as its first child; src/assets/netclaw-icon-purple.svg did 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)

  • Wire the deploy hook per ops/auto-rebuild-on-release/README.md (Cloudflare Pages → Deploy Hooks; add WEBSITE_DEPLOY_HOOK secret to netclaw-dev/netclaw; drop the workflow file in).
  • Consider swapping marked for @astrojs/markdown-remark to unify markdown rendering across docs and release notes (would enable mermaid in release bodies for free).
  • Consider extracting a shared BaseLayout so the GA snippet, fonts, favicons, and footer stop being duplicated between index.astro and ChangelogLayout.astro.

Verification

  • npm run build passes — 112 pages built (was 55 before this branch).
  • Preview tested over Tailscale at /, /changelog, /changelog/0.19.0, /changelog/0.18.2 — all 200, content correct, navbars identical between landing and changelog (same SiteNav component instance).
  • GPG-signed commits.

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.
@Aaronontheweb Aaronontheweb enabled auto-merge (squash) May 20, 2026 21:10
@Aaronontheweb Aaronontheweb merged commit ca2d0b4 into dev May 20, 2026
2 checks passed
@Aaronontheweb Aaronontheweb deleted the feature/changelog-page branch May 20, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant