Skip to content

docs: emit clean URLs without the .html suffix - #111

Merged
puckey merged 1 commit into
mainfrom
docs/clean-urls
Aug 11, 2026
Merged

docs: emit clean URLs without the .html suffix#111
puckey merged 1 commit into
mainfrom
docs/clean-urls

Conversation

@puckey

@puckey puckey commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

VitePress was linking internally to /guide/getting-started.html. Cloudflare Pages 308-redirects that to the extensionless path, so every internal link cost a redirect — an extra round trip for anyone entering on a deep link, and a redirect on every internal link from a crawler's point of view.

cleanUrls: true makes VitePress emit /guide/getting-started while still writing getting-started.html to disk.

Behaviour on both hosts

Request GitHub Pages Cloudflare Pages
/guide/getting-started 200 200
/guide/getting-started.html 200 308 → extensionless

Both serve foo.html at /foo natively, so this is correct on the current host and the future one. Already-indexed .html URLs keep resolving either way.

Verification

  • Built output links are extensionless: href="/guide/getting-started"
  • Output files are unchanged on disk — still guide/getting-started.html
  • yarn ci:format and yarn ci:lint pass

VitePress was linking internally to /guide/getting-started.html. Cloudflare
Pages 308-redirects that to the extensionless path, so every internal link
on the site cost a redirect — an extra round trip on any deep-link entry,
and a redirect on every internal link as far as a crawler is concerned.

cleanUrls makes VitePress emit /guide/getting-started while still writing
getting-started.html to disk. Cloudflare Pages serves that at 200, and so
does GitHub Pages, so the site is correct on both hosts before and after the
move.

Existing .html URLs keep resolving: 200 on GitHub Pages, 308 on Cloudflare.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying audiobrowser with  Cloudflare Pages  Cloudflare Pages

Latest commit: 10b6f1b
Status: ✅  Deploy successful!
Preview URL: https://a4357e26.audiobrowser.pages.dev
Branch Preview URL: https://docs-clean-urls.audiobrowser.pages.dev

View logs

@puckey
puckey merged commit 67ba6fb into main Aug 11, 2026
4 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.2.0-next.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@radio-garden-release

Copy link
Copy Markdown

🎉 This PR is included in version 0.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant