Skip to content

feat: Add support for advanced redirect types #117

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

Merged
merged 4 commits into from
Apr 20, 2022
Merged

feat: Add support for advanced redirect types #117

merged 4 commits into from
Apr 20, 2022

Conversation

sarahetter
Copy link
Contributor

@sarahetter sarahetter commented Apr 20, 2022

This PR adds support for advanced redirect types in gatsby, as mentioned in their support blog post

  • Wildcard path redirects
  • Splat redirects
  • Country based redirects
  • Language based redirects
  • Query param redirects

I've also added a snapshot test to ensure that each of these types of redirects are being output to the _redirects file properly.

Closes: #93

@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Apr 20, 2022
Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

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

Nice work! I didn't realise they'd done a blog about it. We should post something about this, even if it's just an announcement in the forums

@sarahetter
Copy link
Contributor Author

Ah maybe blog post isn't the right term - just a post in their Support's "How to Guide". I couldn't find any similar examples in their official docs.

@kodiakhq kodiakhq bot merged commit d547a28 into main Apr 20, 2022
@kodiakhq kodiakhq bot deleted the redirects branch April 20, 2022 14:10
@ascorbic
Copy link
Contributor

Oh yeah. Looks like that's their cloud support guide, because it's not in the main OSS product

Comment on lines -20 to -21
`Language`,
`Country`,

Choose a reason for hiding this comment

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

This was a breaking change and it should have been introduced in a major bump. All the redirects were possible previously, but the change broke our delpoyment. I do agree that the conditions key may be more suitable, but let's just be cautious with the breaking changes in the future.

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for new redirect types
3 participants