From 07cbd16a352f504fea3c34703be38cdc872fa5b4 Mon Sep 17 00:00:00 2001 From: Darius Cepulis Date: Wed, 15 Jul 2026 12:47:08 -0700 Subject: [PATCH] fix(site): render changelog with shared MDX typography (#1846) --- .github/workflows/changelog-prose.yml | 7 +- .github/workflows/release-pr.yml | 6 +- site/CLAUDE.md | 6 +- site/src/content.config.ts | 8 +-- .../{10.0.0-beta.1.md => 10.0.0-beta.1.mdx} | 0 .../{10.0.0-beta.10.md => 10.0.0-beta.10.mdx} | 0 .../{10.0.0-beta.11.md => 10.0.0-beta.11.mdx} | 0 .../{10.0.0-beta.12.md => 10.0.0-beta.12.mdx} | 0 .../{10.0.0-beta.13.md => 10.0.0-beta.13.mdx} | 0 .../{10.0.0-beta.14.md => 10.0.0-beta.14.mdx} | 0 .../{10.0.0-beta.15.md => 10.0.0-beta.15.mdx} | 0 .../{10.0.0-beta.16.md => 10.0.0-beta.16.mdx} | 0 .../{10.0.0-beta.17.md => 10.0.0-beta.17.mdx} | 0 .../{10.0.0-beta.18.md => 10.0.0-beta.18.mdx} | 0 .../{10.0.0-beta.19.md => 10.0.0-beta.19.mdx} | 0 .../{10.0.0-beta.2.md => 10.0.0-beta.2.mdx} | 0 .../{10.0.0-beta.20.md => 10.0.0-beta.20.mdx} | 0 .../{10.0.0-beta.21.md => 10.0.0-beta.21.mdx} | 0 .../{10.0.0-beta.22.md => 10.0.0-beta.22.mdx} | 0 .../{10.0.0-beta.23.md => 10.0.0-beta.23.mdx} | 0 .../{10.0.0-beta.24.md => 10.0.0-beta.24.mdx} | 0 .../{10.0.0-beta.25.md => 10.0.0-beta.25.mdx} | 0 .../{10.0.0-beta.3.md => 10.0.0-beta.3.mdx} | 0 .../{10.0.0-beta.4.md => 10.0.0-beta.4.mdx} | 0 .../{10.0.0-beta.5.md => 10.0.0-beta.5.mdx} | 0 .../{10.0.0-beta.6.md => 10.0.0-beta.6.mdx} | 0 .../{10.0.0-beta.7.md => 10.0.0-beta.7.mdx} | 0 .../{10.0.0-beta.8.md => 10.0.0-beta.8.mdx} | 0 .../{10.0.0-beta.9.md => 10.0.0-beta.9.mdx} | 0 site/src/pages/changelog/[...slug].astro | 65 +------------------ 30 files changed, 18 insertions(+), 74 deletions(-) rename site/src/content/changelog/{10.0.0-beta.1.md => 10.0.0-beta.1.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.10.md => 10.0.0-beta.10.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.11.md => 10.0.0-beta.11.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.12.md => 10.0.0-beta.12.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.13.md => 10.0.0-beta.13.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.14.md => 10.0.0-beta.14.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.15.md => 10.0.0-beta.15.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.16.md => 10.0.0-beta.16.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.17.md => 10.0.0-beta.17.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.18.md => 10.0.0-beta.18.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.19.md => 10.0.0-beta.19.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.2.md => 10.0.0-beta.2.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.20.md => 10.0.0-beta.20.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.21.md => 10.0.0-beta.21.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.22.md => 10.0.0-beta.22.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.23.md => 10.0.0-beta.23.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.24.md => 10.0.0-beta.24.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.25.md => 10.0.0-beta.25.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.3.md => 10.0.0-beta.3.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.4.md => 10.0.0-beta.4.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.5.md => 10.0.0-beta.5.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.6.md => 10.0.0-beta.6.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.7.md => 10.0.0-beta.7.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.8.md => 10.0.0-beta.8.mdx} (100%) rename site/src/content/changelog/{10.0.0-beta.9.md => 10.0.0-beta.9.mdx} (100%) diff --git a/.github/workflows/changelog-prose.yml b/.github/workflows/changelog-prose.yml index b99c3f48..59de4d30 100644 --- a/.github/workflows/changelog-prose.yml +++ b/.github/workflows/changelog-prose.yml @@ -75,7 +75,7 @@ jobs: - name: Guard — check raw changelog exists id: guard run: | - FILE="site/src/content/changelog/${{ steps.version.outputs.version }}.md" + FILE="site/src/content/changelog/${{ steps.version.outputs.version }}.mdx" if [ ! -f "$FILE" ]; then echo "::warning::Raw changelog file $FILE not found on main — skipping prose generation" echo "skip=true" >> "$GITHUB_OUTPUT" @@ -103,8 +103,8 @@ jobs: 1. **Load context:** - Read `.claude/skills/docs/references/writing-style.md` for tone and style rules. - - Read the raw changelog at `site/src/content/changelog/${{ steps.version.outputs.version }}.md`. - - Read other existing `.md` files in `site/src/content/changelog/` (if any) to match their tone and format. + - Read the raw changelog at `site/src/content/changelog/${{ steps.version.outputs.version }}.mdx`. + - Read other existing `.mdx` files in `site/src/content/changelog/` (if any) to match their tone and format. - List the available docs pages so you can link them: `ls site/src/content/docs/concepts site/src/content/docs/how-to site/src/content/docs/reference`. A page's slug is its path under `site/src/content/docs/` without the extension (e.g. `reference/menu.mdx` → `reference/menu`). 2. **Gather PR context:** @@ -140,6 +140,7 @@ jobs: - Omit features reverted before this release. If a PR appears alongside a revert of it (the raw file's Revert section, or a revert commit in the range), it did not ship — leave it out entirely. - Summarize smaller fixes briefly, grouped. Skip internal-only changes (CI, tooling, changelog maintenance) — unless the release is entirely internal, in which case describe it honestly in a sentence or two rather than leaving the body empty. - If the raw file has a "New Contributors" section, remove it and end with one sentence thanking first-time contributors by name, linking their GitHub profiles. + - Keep the result valid MDX: put code-like text containing `<`, `>`, `{`, or `}` in backticks, and escape those characters in ordinary prose. - Follow `writing-style.md` strictly. Do not fabricate — stick to what the PRs actually say. 4. **Write the `description` field:** diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 187e5072..410bab48 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -65,6 +65,10 @@ jobs: BODY=$(tail -n +"$((LINE_NUM + 1))" CHANGELOG.md) fi + # Commit titles are untrusted MDX input. Escape JSX/expression + # delimiters outside inline code spans while preserving their output. + BODY=$(printf '%s\n' "$BODY" | perl -pe 's{(`[^`]*`)(*SKIP)(*F)|([<>{}])}{\\$2}g') + # Determine prerelease and breaking PRERELEASE=false if echo "$VERSION" | grep -q '-'; then @@ -80,7 +84,7 @@ jobs: COMPARE_URL=$(grep -Fm1 "[@videojs/core@${VERSION}]: " CHANGELOG.md | sed 's/.*]: //' || true) # Write the site changelog file - OUTFILE="site/src/content/changelog/${VERSION}.md" + OUTFILE="site/src/content/changelog/${VERSION}.mdx" mkdir -p "$(dirname "$OUTFILE")" cat > "$OUTFILE" <`, `{`, or `}`) must be put in backticks or escaped. -**Filename convention:** `{version}.md` (e.g. `10.0.0-beta.24.md`) — the filename is the entry id and URL slug: `/changelog/10.0.0-beta.24/`. +**Filename convention:** `{version}.mdx` (e.g. `10.0.0-beta.24.mdx`) — the filename is the entry id and URL slug: `/changelog/10.0.0-beta.24/`. **Schema:** ```ts @@ -482,7 +482,7 @@ Without a manual override, `Base.astro` derives `/og/{slug}.png` and `/og/twitte } ``` -**Rendering caveat:** Astro's `components` prop on `` is MDX-only, so the typography components don't apply to changelog bodies. `src/pages/changelog/[...slug].astro` mirrors their styles in a scoped `