A plugin for Pretzel, mimicing the JekyllRedirectFrom gem.
PowerShell C#
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.vscode
.gitattributes
.gitignore
LICENSE.md
Pretzel.RedirectFrom.csx
README.md
run-tests.ps1
test-helper.ps1

README.md

Pretzel.RedirectFrom

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.

Build status

Installation

Copy Pretzel.RedirectFrom.csx to the _plugin folder at the root of your site folder.

Usage

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.