fix(docs): serve changelog pages as Markdown at .md URLs - #5460
Open
vfanucci wants to merge 1 commit into
Open
Conversation
Every `/docs/changelog/*.md` URL returned a 404 HTML error page, while the same URL without the extension returned 200. Measured against the docs sitemap: 490 of 591 docs URLs served `text/markdown`, and all 101 failures were the changelog index plus its 100 release pages. The catch-all `docs/[...docsPath].md.ts` builds its paths from the `docs` content collection, but changelog pages come from the GitHub releases API and are in no collection, so no `.md` path was ever emitted for them. This breaks a contract the site advertises in two places — the docs layout blockquote and llms-full.txt both state "append .md to any kestra.io/docs/* URL for plain Markdown" — so AI agents following it hit 404s on all release notes. Adds `docs/changelog/[tag].md.ts` (mirroring the getStaticPaths of `[tag].astro`, same 150 limit) and `docs/changelog.md.ts` for the index, with the rendering extracted to `utils/changelogMarkdown.ts` and unit tested. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
☁️ Cloudflare Worker Preview Deployed!🔗 https://ks-fix-changelog-markdown-endpoin-docs.kestra-io.workers.dev 🔦 Lighthouse Benchmark
Scores (0–100, higher is better)
Core Web Vitals (lower is better)
Legend🟢 improved · 🔻 regressed · (blank) no significant change View full Lighthouse HTML report for a pageFull per-page Lighthouse Results (LHR) are attached as the |
Contributor
Author
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.

Problem
Every
/docs/changelog/*.mdURL returns a 404 HTML error page, while the same URL without the extension returns 200.I checked all 591 docs URLs in
sitemap/docs.xml:200+text/markdown404+text/htmlAll 101 failures are the changelog namespace — the index (
/docs/changelog.md) plus its 100 release pages (v0.22.41→v1.3.36). No other docs URL is affected.This breaks a contract the site advertises in two places:
DocsLayout.astro— "Append.mdto anykestra.io/docs/*URL for plain Markdown."llms-full.txt.ts— same statementSo an AI agent that follows the documented instruction gets a 404 on every single release note.
Cause
The catch-all route
src/pages/docs/[...docsPath].md.tsbuilds its paths fromgetCollection("docs"), i.e. the Markdown files in this repo. Changelog pages are built from the GitHub releases API insrc/pages/docs/changelog/[tag].astroand belong to no content collection, so no.mdpath was ever emitted for them.Fix
src/pages/docs/changelog/[tag].md.ts— mirrors thegetStaticPathsof[tag].astro(samefetchMajorReleasessource and 150 limit), so every release page that gets built also gets a Markdown endpointsrc/pages/docs/changelog.md.ts— the index, listing every release with its date and page URL, as a discovery entry pointsrc/utils/changelogMarkdown.ts— rendering extracted so it is unit-testable, keeping the routes thinsrc/utils/changelogMarkdown.test.ts— 6 tests (name/tag fallback, missing body, missing date, empty release list)Both endpoints return
text/markdown; charset=utf-8, matching the existingdocs.md.tsand[...docsPath].md.tspattern. Release bodies keep the commit-link rewriting already done byfetchMajorReleases.Verification
Against the local dev server, replaying the exact 101 URLs that 404 in production:
200 text/markdownv1.2.3,v0.23.27) 404 in both HTML and.md— they have dropped out of the GitHub API response window, so their.astropages 404 too. Unrelated to this change; see follow-up below.Spot-checked output of
/docs/changelog/v1.3.35.md(h1, sections, rewritten commit links, contributors) and/docs/changelog.md(100 dated release links).vitest run: 10 files / 79 tests passing.oxlintclean.Follow-ups (not in this PR)
llms.txtandllms-full.txt(0 occurrences ofdocs/changelogin either). Release notes remain invisible to LLM consumers even with these endpoints live; they should be listed.fetchMajorReleases(150)requestsper_page=150, but the GitHub API capsper_pageat 100. Only ~100 release pages are ever built, so older changelog URLs silently start 404ing as new releases ship — including URLs that were in the sitemap and may be linked externally. Worth pagination or a redirect strategy.🤖 Generated with Claude Code