Skip to content
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

fix(v2): unbreak blog-only mode routing by deplicating starting forward slashes #2497

Merged
merged 1 commit into from
Apr 2, 2020
Merged

fix(v2): unbreak blog-only mode routing by deplicating starting forward slashes #2497

merged 1 commit into from
Apr 2, 2020

Conversation

SamChou19815
Copy link
Contributor

@SamChou19815 SamChou19815 commented Apr 2, 2020

Motivation

Fix #2493

In blog-only mode, we will have URL components like this:

[/* site baseUrl */ '/', /* blog routeRootUrl */ '/',  '/2020/01/01/foo-bar']

, which will be normalized to //2020/01/01/foo-bar by the old algorithm.

My fix adds a final pass that collapses all forward slashes at the beginning of the final string into 1 slash, so //2020/01/01/foo-bar will become /2020/01/01/foo-bar

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Now blog-only mode has correct path:

Screen Shot 2020-04-01 at 22 49 53

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 2, 2020
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 7194abb

https://deploy-preview-2497--docusaurus-2.netlify.com

Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

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

Thanks as always Sam ❤️

TIL - deplicate

@yangshun yangshun changed the title fix(v2): Unbreak blog-only mode routing by deplicating starting forward slashes fix(v2): unbreak blog-only mode routing by deplicating starting forward slashes Apr 2, 2020
@yangshun yangshun merged commit da7fd1a into facebook:master Apr 2, 2020
@yangshun yangshun added the pr: bug fix This PR fixes a bug in a past release. label Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v2: blog-only mode blog post link is broken
4 participants