:twisted_rightwards_arrows: Seamlessly specify multiple redirections URLs for your pages and posts.
The JekyllRedirectFrom gem is a tool that allows users to give Jekyll posts and pages multiple URLs. This is useful when importing posts and pages from platforms like Tumblr, where it would be impractical to create new pages in the proper subdirectories. Instead of manually maintaining pages for redirection, the gem handles the redirects by serving an HTML file with an HTTP-REFRESH metatag pointing to the desired destination.
_layouts directory called redirect.html.site.url is set, it can be used as a prefix for the redirect URL along with site.baseurl.redirect_to key.To install the JekyllRedirectFrom gem, add the following line to your application’s Gemfile:
gem 'jekyll-redirect-from'
Then, execute the command:
bundle install
Alternatively, you can install the gem manually by running:
gem install jekyll-redirect-from
Once installed, add it to your _config.yml file. If you are using Jekyll version less than 3.5.0, use the gems key instead of plugins. If you’re using Jekyll in safe mode, make sure to add jekyll-redirect-from to your whitelist before running jekyll <cmd> --safe.
Overall, the JekyllRedirectFrom gem is a useful tool for managing redirects in Jekyll. It simplifies the process of creating and maintaining redirects, allowing authors to specify multiple URLs for a page. The gem handles the redirects by serving HTML files with HTTP-REFRESH metatags. It also provides customization options for the redirect template and supports redirecting to external websites.