jekyll / jekyll-redirect-from

:twisted_rightwards_arrows: Seamlessly specify multiple redirections URLs for your pages and posts.
MIT License
782 stars 113 forks source link

Add ability to specify a list of redirects in `_config.yml` #251

Closed tordans closed 2 years ago

tordans commented 2 years ago

UseCase: I want split up a project and migrate a big part of a Jekyll site (~50 % of pages) into a different domain (Jekyll site).

Right now, I need to keep all the .html/.md files, empty the content and front mattet and add a redirect_to: <new extern url> to all pages. That does work, but I have to keep around all files which makes my code messy.

Outside of Github pages (on my own server or on Netlify) I could consolidate all those redirects in one place (the .htaccess or _redirects file).

It would be great, if such a use case could be supported in Jekyll as well: I could specify a list of redirects <from_path> <to_path_or_url> right inside the _config.yml or an external data/redirects.yml (referenced in the _config) that in turn would create the pages in their right places.

Some of the logic for this is already there with the redirect_from-Option.

Current hacky workaround:

In fact, using redirect_from we can solve the issue of keeping all redirects in one place in a okayisch hacky way: We can create page for each redirect in a separate folder and use redirect_from (redirect the original location to this new redirect file; first redirect), redirect_to (redirect this new file to the final location; second redirect) for the redirect. This cleans up the code nicely without increasing the file count. It is also okayisch from a SEO point of view since the chain of canonical URLs ist still valid and just increased by one.

jekyllbot commented 2 years ago

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master/main branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.