Skip to content

fix(docs): rename agents/*.md to .mdx so JSX components render#89

Merged
theagenticguy merged 1 commit into
mainfrom
fix/agents-mdx-extension
May 10, 2026
Merged

fix(docs): rename agents/*.md to .mdx so JSX components render#89
theagenticguy merged 1 commit into
mainfrom
fix/agents-mdx-extension

Conversation

@theagenticguy
Copy link
Copy Markdown
Owner

Summary

Astro v2.0 removed legacy.astroFlavoredMarkdown — JSX components and import statements only render in .mdx files. The 13 pages under packages/docs/src/content/docs/agents/ (shipped in PR #87) were authored as .md with <Card> / <CardGrid> / <LinkCard> JSX. Astro silently dropped the components and rendered prose-only.

Verified against current Starlight + Astro docs via Context7:

Removed: legacy.astroFlavoredMarkdown — Astro v2.0 removes it completely. Importing and using components in .md files will no longer work.

Fix

  • git mv all 13 agents/**/*.md*.mdx.
  • 6 bare autolinks in registries.mdx (<https://...>) converted to standard [text](url) markdown — MDX is stricter than MD and treats <https://...> as a JSX tag.

Verification

  • pnpm -F @opencodehub/docs build exits 0 — 64 pages built, all internal links valid, llm-nav still patches the 63 sibling .md files Astro emits alongside .html
  • curl http://localhost:4321/opencodehub/agents/ shows rendered sl-link-card and CardGrid markup where the JSX expanded
  • The orphaned May-1 site at https://theagenticguy.github.io/opencodehub/agents/ was the trigger — user reported LinkCard not loading. Confirmed in WebFetch that the live site previously rendered prose-only with no card grids.

Test plan

  • CI green
  • After merge, Pages workflow re-deploys and /agents/ shows the editor card grid + LinkCard navigation visible inline

Astro v2.0 removed legacy.astroFlavoredMarkdown — `import` statements
and JSX components (Card, CardGrid, LinkCard, Tabs) only render when
the file extension is `.mdx`. Verified against current
`@withastro/starlight` and `@withastro/docs` Context7 sources:

> Removed: `legacy.astroFlavoredMarkdown` — In v1.0, Astro moved the
> old Astro-Flavored Markdown to a legacy feature. Astro v2.0 removes
> it completely. Importing and using components in `.md` files will
> no longer work.

The 13 pages under `packages/docs/src/content/docs/agents/` were
authored with `import { Card, CardGrid, LinkCard } from
"@astrojs/starlight/components"` at the top — under `.md` Astro
silently dropped the JSX, so the live site rendered no editor cards
on /agents/, no setup grid on /agents/install/, no failure-mode cards
on /agents/why-mcp/, etc. Plain prose-only output.

Renamed all 13 to `.mdx` via `git mv`. The follow-on issue MDX
introduced was strict-parser fatal-on-bare-autolinks (`<https://...>`
is interpreted as a JSX tag). Six occurrences in `registries.mdx`
converted to standard `[text](url)` markdown link syntax.

Verified locally:
- `pnpm -F @opencodehub/docs build` -> 64 pages, all internal links
  valid, llm-nav still patches the 63 sibling .md files astro emits
  alongside the .html
- `curl http://localhost:4321/opencodehub/agents/` shows rendered
  `sl-link-card` and `CardGrid` markup where the `<LinkCard>` /
  `<CardGrid>` JSX expanded
@theagenticguy theagenticguy merged commit c973826 into main May 10, 2026
37 checks passed
@theagenticguy theagenticguy deleted the fix/agents-mdx-extension branch May 10, 2026 19:14
@github-actions github-actions Bot mentioned this pull request May 10, 2026
theagenticguy added a commit that referenced this pull request May 10, 2026
## Summary

Astro v2.0 removed `legacy.astroFlavoredMarkdown` — JSX components and
`import` statements only render in `.mdx` files. The 13 pages under
`packages/docs/src/content/docs/agents/` (shipped in PR #87) were
authored as `.md` with `<Card>` / `<CardGrid>` / `<LinkCard>` JSX. Astro
silently dropped the components and rendered prose-only.

Verified against current Starlight + Astro docs via Context7:

> Removed: `legacy.astroFlavoredMarkdown` — Astro v2.0 removes it
completely. Importing and using components in `.md` files will no longer
work.

## Fix

- `git mv` all 13 `agents/**/*.md` → `*.mdx`.
- 6 bare autolinks in `registries.mdx` (`<https://...>`) converted to
standard `[text](url)` markdown — MDX is stricter than MD and treats
`<https://...>` as a JSX tag.

## Verification

- `pnpm -F @opencodehub/docs build` exits 0 — 64 pages built, all
internal links valid, llm-nav still patches the 63 sibling `.md` files
Astro emits alongside `.html`
- `curl http://localhost:4321/opencodehub/agents/` shows rendered
`sl-link-card` and `CardGrid` markup where the JSX expanded
- The orphaned May-1 site at
`https://theagenticguy.github.io/opencodehub/agents/` was the trigger —
user reported `LinkCard` not loading. Confirmed in WebFetch that the
live site previously rendered prose-only with no card grids.

## Test plan

- [ ] CI green
- [ ] After merge, Pages workflow re-deploys and `/agents/` shows the
editor card grid + LinkCard navigation visible inline
@github-actions github-actions Bot mentioned this pull request May 11, 2026
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