-
Notifications
You must be signed in to change notification settings - Fork 922
feat: add route option (close #1505) #1538
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
base: main
Are you sure you want to change the base?
Conversation
ab871fa to
f05b2e9
Compare
Pull Request Test Coverage Report for Build 13690296414Details
💛 - Coveralls |
|
now e2e test is added in this PR |
c5baa4e to
9e3789c
Compare
a9c1418 to
bddd418
Compare
bddd418 to
fdefcd8
Compare
|
In the - .e2e-theme-content #hash-and-query + ul > li a
^^^^^^^^^^^^^^
+ .e2e-theme-content #query-and-hash + ul > li awhich causes the e2e test to fail due to the inability to find the element. |
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.
The regular expression here does not satisfy path matching after enabling cleanUrl. For strings in the format of /xxx, it always returns false, and the value of href in linksPlugin is skipped during parsing, resulting in /xxx instead of /xxx.html.
The regular expression requires that the path part must end with /, .html, or .md, and it is clear that /xxx does not meet this requirement.
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.
This is excepted, even with cleanUrl, users are required to add .md extension .
|
I would really love to see this in VuePress, this is the one thing preventing me from using it. |
|
If @meteorlxy is happy to review it, then I am totally fine to refine this asap. |


Warning
This PR is now based on #1562, so it's expected #1562 to be merged first.
Tip
For a file like
/a/b.md, the full format is/a/b.htmland clean format is/a/bFeatures
This pr adds
routeoption for vuepress config file.route.cleanUrloption to support the "clean format"pagePatternsandpermalinkPattenis moved toroute.pagePatternsandroute.permalinkPattenBug Fixes
Previously, when use manually set a permalink or page path to a clean format like
/a, they will always get 404 when trying to visit the page (in any link format). Now, this is correctly handled. Page path will be normalized to a "full" or "clean" version based oncleanUrl, no matter user use "clean", "full" format or mixing them.Performance Improvements
Now, the key in routes is always the clean format, which avoid outputting uncessary
.htmlsuffix for most pages.Potential Breaking Changes
inferRoutePathandnormalizeRoutePathreturn the "clean" format instead of "full" format.Tweaks
Now a new field called routeKey is on the
Pageobject.