Skip to content

Release 2.3.1-beta.1 - #488

Open
sohail2721 wants to merge 3 commits into
betafrom
dev
Open

sohail2721 wants to merge 3 commits into
betafrom
dev

Conversation

@sohail2721

@sohail2721 sohail2721 commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Promotes dev to beta. This should publish 2.3.1-beta.1 to the npm beta dist-tag as a GitHub prerelease. The release run commits nothing back to beta; the tag goes on this PR's merge commit. dev already contains main's 2.3.0 merge, so the version continues from v2.3.0.

Merge with Create a merge commit.

What releases

Everything on dev since 2.3.0: one fix, with nothing marked !, so a patch prerelease:

Changes for users

This only affects a portal hosted under a sub-path: one whose site.url has a path, or a preview at /p/<id>/.

  • An external <Card> with a root-relative href now goes under the path, as a Markdown link already does. The template's "Agent-Friendly Docs" card leads to /docs/llms.txt instead of a 404 at /llms.txt.
  • An external card that used a root-relative address to reach another app on the same host now goes under the path too: /pricing leads to /docs/pricing. Link such an app with a full URL.

A portal at the root of its domain renders exactly as before.

Before this beta goes to main

🤖 Generated with Claude Code

sohail2721 and others added 3 commits November 24, 2026 11:28
…s sub-path (#486)

A portal hosted under a sub-path, such as a preview at `/p/<id>/` or
`acme.github.io/docs`, linked the template's "Agent-Friendly Docs" card
to the host's root, where there is no file.

## What was wrong

The default content links the card like this:

```mdx
<Card title="Agent-Friendly Docs" href="/llms.txt" external />
```

fumadocs-core's `Link` renders an `external` link as a plain `<a
target="_blank">` and never hands it to the router. The router is what
adds the base path. Under `/p/abc123/`, the card was `href="/llms.txt"`
and got a 404, while the SDKs card beside it was `/p/abc123/sdks`. At
the root of a domain nothing was wrong.

## The fix

An external card now reads a `/…` address the way the rest of the portal
does. `external` changes only how the card opens: a plain link, in a new
tab.

- **One rule, in one place.** `underBase` in `lib/base-path.ts` puts any
root-relative address under the base, as the router does for links. It
also leaves `https://…`, `//…`, `mailto:`, relative and `#` addresses as
written.
- The Card override in `components/mdx.tsx` uses it for external cards.
- The images in API descriptions (`api-markdown.tsx`) use it too,
replacing their own copy of the regex.
- **It covers every file the portal serves under the path:** `llms.txt`
and the other generated files, the pages' `.md` copies, files from
`static/` and the `/__downloads/` zips. It also covers a page opened in
a new tab.
- **The prerender and the browser both get it.** Fumadocs' server MDX
entry reuses the same components.
- **Existing build directories need no change,** because the fix is in
rendering, not in their content.

**A change in behavior, under a sub-path only.** Under a sub-path, an
external card to `/pricing` now leads to `/docs/pricing`. One written as
`/docs/llms.txt` now leads to `/docs/docs/llms.txt`. A Markdown link
already behaved this way. To link outside the portal, write a full URL.
At the root of a domain nothing changes.

## Not covered

- **Clicking a Markdown or header link to `/llms.txt`.** Its href is
right, because the router adds the base. But the click navigates inside
the app and shows the portal's own "Page Not Found" instead of the file,
at the root as well. Reloading the page shows the file. It's filed as
#487.
- **Header links from `portal.navigation.links`** are not affected: the
CLI marks only `http(s)://` addresses as external, so the rest go to the
router.

## Checked

- A copy of the `subpath` fixture with the default cards, built at
`https://docs.test/p/abc123` and driven in headless Chrome:

  | Link | Before | After |
  | --- | --- | --- |
| Agent-Friendly Docs card | `/llms.txt`, 404 | `/p/abc123/llms.txt`,
200, new tab |
  | SDKs card | `/p/abc123/sdks` | unchanged |
  | Same card, portal at the root | `/llms.txt`, 200 | unchanged |

- `test/portal-template/base-path.test.ts` checks `underBase`.
Root-relative addresses go under the base, `/docs/llms.txt` included, as
the router reads it. Every other kind of address is left as written.
- `test/portal-template/card.test.ts` (new) renders the real Card
override under `/docs/`. An external card gets the path and still opens
a new tab. A card not marked external goes to the router as written.
- `test/helpers/template-render.ts` holds the Vite render setup that
`card.test.ts`, `page-actions.test.ts` and
`authorization-failure.test.ts` now share.
- `test/e2e/portal-build.test.ts`:
- The `subpath` fixture's figures page links two external cards, to
`/api/llms.txt` and `/api/api/search.json`. The second address starts
like the base and still goes under it.
  - The root build keeps `/llms.txt`.
- A mocha run with every test file loaded, as CI loads them, filtered to
the root and sub-path e2e and the template's tests: 78 passing,
including the template's type check.

I did not run the whole suite.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Muhammad Sohail <sohail.shahbaz@apimatic.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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