docs: emit clean URLs without the .html suffix - #111
Merged
Conversation
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.
Deploying audiobrowser with
|
| Latest commit: |
10b6f1b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a4357e26.audiobrowser.pages.dev |
| Branch Preview URL: | https://docs-clean-urls.audiobrowser.pages.dev |
|
🎉 This PR is included in version 0.2.0-next.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 0.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: truemakes VitePress emit/guide/getting-startedwhile still writinggetting-started.htmlto disk.Behaviour on both hosts
/guide/getting-started/guide/getting-started.htmlBoth serve
foo.htmlat/foonatively, so this is correct on the current host and the future one. Already-indexed.htmlURLs keep resolving either way.Verification
href="/guide/getting-started"guide/getting-started.htmlyarn ci:formatandyarn ci:lintpass