Skip to content

Migrate website to Nextra v4#576

Open
FrancoKaddour wants to merge 2 commits into
davesnx:mainfrom
FrancoKaddour:feat/nextra-v4-migration
Open

Migrate website to Nextra v4#576
FrancoKaddour wants to merge 2 commits into
davesnx:mainfrom
FrancoKaddour:feat/nextra-v4-migration

Conversation

@FrancoKaddour

Copy link
Copy Markdown

Picks up #537.

Main changes:

  • nextra 3 → 4, next 14 → 15, react 18 → 19
  • Pages Router replaced by App Router — all MDX files moved to content/
  • app/layout.tsx takes over what _app.tsx and _document.tsx were doing
  • app/[[...mdxPath]]/page.tsx handles the catch-all MDX routing
  • mdx-components.tsx added at root (required by v4)
  • getHighlighter swapped for createHighlighter (Shiki v1 stable API)
  • next.config.mjs: theme option removed (no longer supported in v4)
  • src/index.tsx: updated to accept pageMap from getPageMap() instead of NextraThemeLayoutProps
  • src/contexts/config.tsx: useRouter (next/router) → usePathname (next/navigation)
  • src/components/head.tsx: next/head removed, meta tags moved to layout metadata

Still pending: replacing the custom FlexSearch with Pagefind's client integration. Happy to continue on that in a follow-up if useful.

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@FrancoKaddour is attempting to deploy a commit to the David Sancho's projects Team on Vercel.

A member of the Team first needs to authorize it.

"scripts": {
"dev": "next dev -p 3456",
"build": "next build",
"postbuild": "pagefind --site .next/server/app --output-path public/_pagefind",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't checked nextra recently, but what's is the pagefind? 🤔

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pagefind is a static search library that indexes the built HTML output and provides client-side search with no server required. Nextra v4 dropped the built-in FlexSearch integration, so pagefind is the recommended replacement — it runs as a postbuild step and generates the search index from .next/server/app.

That said, the client-side integration (the search UI component) is still pending — I noted it in the PR description. The postbuild script is there but the search won't be functional until that part is wired up. Happy to follow up on that in a separate PR if you want to keep this one focused on the migration itself.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's really nice, wanna do the search in a separate PR entirely?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely, makes more sense to keep this PR focused on the migration. I'll open a follow-up for the Pagefind client integration once this lands.

@davesnx davesnx left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@davesnx

davesnx commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Thanks for taking the time, good update

@FrancoKaddour

Copy link
Copy Markdown
Author

FYI — the CI failure is in demo/melange/build.mjs, which can't find the esbuild package. That's unrelated to the website migration — we didn't touch anything outside packages/website/. Might be a pre-existing issue with the demo build in CI.

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
styled-ppx Ignored Ignored Preview Jun 29, 2026 1:54pm

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.

2 participants