-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat($core): redirects for clean urls #1269
Conversation
c94bebf
to
6fc435a
Compare
If I understood this correctly, the routes will still end in .html? Or am I wrong? |
I have noted it in the description:
FYI, we don't plan to support removing the |
Oh, so that won't happen until 2.x? Which might not happen for a LONG time. :'( I guess I'll use another static site generator for now then, because I can't afford losing search engine rankings when switching URL structure. |
Now you can use plugin-clean-urls if you want your urls to be |
OMG! Amazing, @shigma |
@shigma Well done. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just selected a wrong review target...
Summary
In VuePress, we have following convention about routing:
/foo/
means source file is/foo/{README|index}.md
/foo.html
means your source file is/foo.md
The original design of VuePress relied on above two styles
of routing, especially the calculation involved of routes at
// default theme. so we can't easily modify
/foo.html
directlyto
/foo
(i.e. remove html suffix)This utility handles redirect of clean urls, with this utility, you'll
get:
For unknown request
/foo
/foo.html
if it exists/foo/
if it existsFor unknown request
/foo/
/foo.html
if it existsIf all the above redirect rules don't exist, you'll get a 404
Note that this PR doesn't provide you the ability to remove the
html suffix at the route level, it just allows you to use clean urls.
cc @octref
Related: #603
Related: #608
Related: #1060
Close: #720
Close: #931