[SITE] Auto-parse CHANGELOG.md for /releases page#167
Merged
Conversation
- Extract release parsing logic into parseChangelog utility - Dynamically generate release entries from CHANGELOG.md instead of hardcoding - Support Keep a Changelog format (Added/Changed/Fixed sections) - Auto-tag latest release, extract version/date/summary metadata - Add /releases entry to sitemap with monthly frequency and 0.8 priority - Next rebuild will auto-populate page with all releases from CHANGELOG Tests pass, site builds successfully with parsed data. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Added auto-parsed releases page to [Unreleased] in CHANGELOG - Updated HISTORY.md to note releases page as part of site SEO buildout - Releases page eliminates manual changelog duplication
There was a problem hiding this comment.
Pull request overview
This PR updates the Next.js marketing site to auto-generate the /releases page from the repo root CHANGELOG.md (Keep a Changelog format) at build time, removing the need to maintain a separate hardcoded releases dataset.
Changes:
- Added
site/lib/parseChangelog.tsto parseCHANGELOG.mdinto structured release/section/entry data. - Updated
/releasespage to useparseChangelog()output instead of a hardcoded releases array. - Added
/releasestosite/app/sitemap.tsand documented the milestone inHISTORY.md/CHANGELOG.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| site/lib/parseChangelog.ts | New build-time changelog parser that outputs release metadata and sections for the site. |
| site/app/releases/page.tsx | Swaps hardcoded release data for dynamic parsing from CHANGELOG.md. |
| site/app/sitemap.ts | Adds /releases to the manually curated sitemap. |
| HISTORY.md | Documents the releases page automation as a site milestone. |
| CHANGELOG.md | Notes the new auto-parsed releases page behavior under Unreleased. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+69
to
+82
| // Match version header: ## [1.2.3] - YYYY-MM-DD or ## [Unreleased] | ||
| const versionMatch = trimmed.match(/^##\s+\[([^\]]+)\](?:\s+-\s+(\d{4}-\d{2}-\d{2}))?$/); | ||
| if (versionMatch) { | ||
| // Save previous release if any | ||
| if (currentVersion && allSections.length > 0) { | ||
| releases.push({ | ||
| version: currentVersion, | ||
| date: currentDate, | ||
| tag: currentVersion === "Unreleased" ? "unreleased" : releases.length === 0 ? "latest" : "", | ||
| summary: generateSummary(allSections), | ||
| sections: allSections, | ||
| compareUrl: generateCompareUrl(currentVersion), | ||
| }); | ||
| } |
Comment on lines
+74
to
+78
| releases.push({ | ||
| version: currentVersion, | ||
| date: currentDate, | ||
| tag: currentVersion === "Unreleased" ? "unreleased" : releases.length === 0 ? "latest" : "", | ||
| summary: generateSummary(allSections), |
Comment on lines
+156
to
+158
| // Find the next version to create a comparison URL | ||
| // For now, use the tag-based comparison | ||
| return `https://github.com/EricCogen/GauntletCI/releases/tag/v${version}`; |
| ], | ||
| }, | ||
| ]; | ||
| const releases = parseChangelog(); |
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.
Auto-generate the releases page from CHANGELOG.md at build time instead of maintaining hardcoded release data.
What changed
Why
Release notes were hardcoded in the releases page component, duplicating content from CHANGELOG.md. Any new release required manual updates to both files. This utility eliminates that duplication by extracting metadata at build time, keeping the page always in sync with the authoritative changelog.
Testing
Side effects
None. The releases page component rendering is identical to before - this is purely a data source change from hardcoded to parsed.