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

Automate Netlify Redirects with 11ty #105

Open
AleksandrHovhannisyan opened this issue Sep 5, 2021 · 3 comments
Open

Automate Netlify Redirects with 11ty #105

AleksandrHovhannisyan opened this issue Sep 5, 2021 · 3 comments
Labels
comments Comments section for an article.

Comments

@AleksandrHovhannisyan
Copy link
Owner

No description provided.

@AleksandrHovhannisyan AleksandrHovhannisyan added the comments Comments section for an article. label Sep 5, 2021
@mtsknn
Copy link

mtsknn commented Mar 15, 2023

Thanks for the great idea and thorough instructions!

I implemented this for my site and also configured BrowserSync to read the _redirects file so the redirects work locally too: https://github.com/mtsknn/mtsknn.fi/pull/47/files#diff-dfd0229f5460a1b4ac0ded639e55bd0ccaa1f1eedc9f3e79652cf2f2cc3fe4d7

@AleksandrHovhannisyan
Copy link
Owner Author

@mtsknn Oh wow, very clever! TIL that you can customize the browsersync behavior in 11ty's server. Thanks for sharing!

@mtsknn
Copy link

mtsknn commented Mar 17, 2023

Whoops, looks like Eleventy v2 ships with its own dev server and I'm still using v0.12. 🫣 Should have checked first.

FWIW Eleventy Dev Server's repo has an issue about redirect middlewares.

Edit: Eleventy Dev Server reads middlewares from the options object even though it's not mentioned in the docs, so maybe my Browsersync middleware could be easily ported to Eleventy Dev Server. Also, Netlify Redirect Parser would be more robust than my quick _redirects file parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comments Comments section for an article.
Projects
None yet
Development

No branches or pull requests

2 participants