This is a plugin for Pretzel, a static site generation tool following (more or less) the same conventions as Jekyll. It mimics the JekyllRedirectFrom gem for Jekyll.
Sometimes when migrating a site to Pretzel, you may change the structure of your site. This plugin helps to redirect old URLs to new locations.
Copy Pretzel.RedirectFrom.csx
to the _plugin
folder at the root of your site folder.
Add the old URL to the front-matter of your post or page:
---
title: Awesome page
redirect_from:
- /pages/old-awesome-url.html
---
...
This will generate a new file index.html
in the folder \pages\old-awesome-url.html\
with an HTTP-REFRESH meta tag which redirects to the new page URL.