Max Glenister

Blog & IndieWeb • 2 min read Plain text

Using "jekyll-redirect-from" with GitHub Pages

Last week GitHub finally added support for some useful plugins to their implementation of Jekyll used for GitHub Pages.

The most notable of these is the support for the jekyll-redirect-from plugin.

When I first moved from Tumblr over to Jekyll back in 2012, I wrote about the pains of maintaining old URLs. Tumblr uses a permalink structure of /post/<post-id>/<slug>/, with the <post-id> being an arbitrary number that means nothing to us in Jekyll.

The solution I had arrived at back then was to generate the directory structure using the Jekyll Alias Generator plugin, and then to add the generated redirect pages to my repository.

Not a very nice solution, as it meant keeping the redirects in the code base as generated HTML files, but it was the only solution.

The jekyll-redirect-from plugin does essentially the same thing — outputting a HTML file in your _site/ directory for each redirect you specify, but at least now it’s supported by GitHub pages, so it will mean not cluttering up my codebase.

To use the plugin you have to do a couple of things

  1. Install the gem locally so you can make sure it works on your local Jekyll
gem install jekyll-redirect-from
  1. Enable the gem in your _config.yml (not using a _plugin/ like you might expect)
gems:
  - jekyll-redirect-from
  1. Add redirect_from: [list or single url] to your post frontmatter
redirect_from:
  - "/post/some-old-slug/"

And that’s it.

I’m still waiting for the day when Jekyll supports proper 301 redirecting, but this will do for now.

Read more about jekyll-redirect-from:

  • Blog & IndieWeb · shares #jekyll
    Moving to GitHub Actions (and adding .txt posts)

    This year I moved the blog from GitHub Pages’ built-in Jekyll to a GitHub Actions workflow, then added .txt URL support for posts. Inspired by Terence Eden’s blog post about text-only websites.

    January 2026 • 4 min read
  • Blog & IndieWeb · shares #jekyll
    Jekyll for dummies

    2014 has been heralded as “the year of flat-file websites”. This blog in fact uses Jekyll to generate the very blog post you are reading. I’ve been using Jekyll in some form since early 2012 (here’s how I migrated from Tumblr), and for me it works perfectly as a means to publish content.

    March 2014 • 10 min read
  • Blog & IndieWeb · shares #github-pages
    Reducing commit log noise caused by a GitHub Action

    I have a “now playing” widget on my /now page that shows the last track scrobbled to Last.fm. It’s powered by a GitHub Actions workflow that polls the Last.fm API every hour and commits the result to the repo. It worked fine, but quietly polluted my commit history.

    February 2026 • 4 min read

Discussion

No interactions yet

Join the conversation

Reply from your own site with a Webmention (how?).

Webmentions last fetched 12 November 2026, 12:24