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): redirect plugin should use siteConfig.trailingSlash #4988

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Jun 16, 2021

Motivation

The redirect plugin does not use the new siteConfig.trailingSlash config.

It should, and output different patterns of redirect files according to trailingSlash

Also, it should be more resilient:

  • user has redirect.to=/abc and user wants to use trailingSlash=true
  • then /abc is not a valid path to redirect to anymore => it is now /abc/
  • we should not need to ask the user to change its redirect config paths, we can consider that he now wants to redirect to /abc/ automatically
  • it becomes easier to test the trailingSlash: true without having to also update the redirect options

Also, it allows for easier trailingSlash dogfooding: we can now more easily change trailingSlash for our site prod/deployPreview without having to change redirect options (ie add/remove to trailing slashes in options => annoying)

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

tests

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Jun 16, 2021
@slorber slorber requested a review from lex111 as a code owner June 16, 2021 16:32
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 16, 2021
@netlify
Copy link

netlify bot commented Jun 16, 2021

✔️ [V2]

🔨 Explore the source changes: 7e1a0fe

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/60ca279654e9ed0007245a96

😎 Browse the preview: https://deploy-preview-4988--docusaurus-2.netlify.app

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 58
🟢 Accessibility 97
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-4988--docusaurus-2.netlify.app/

@github-actions
Copy link

Size Change: 0 B

Total Size: 624 kB

ℹ️ View Unchanged
Filename Size Change
website/build/assets/css/styles.********.css 87.6 kB 0 B
website/build/assets/js/main.********.js 445 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 63.3 kB 0 B
website/build/docs/introduction/index.html 235 B 0 B
website/build/index.html 28.1 kB 0 B

compressed-size-action

@slorber slorber merged commit b54ec72 into master Jun 16, 2021
@slorber slorber deleted the slorber/redirect-plugin-trailingSlash branch August 17, 2021 18:01
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.

None yet

2 participants