1
votes

I'm contributing to an open source project that has its documentation built in Jekyll and hosted on Github Pages. I'm trying to add a redirect in the documentation, so I've forked it and am using jekyll-redirect-from in the fork. However, the redirect simply doesn't seem to be applied. That is, the jekyll build folder doesn't contain any static file to hold the <meta redirect> html that jekyll-redirect-from is supposed to generate. Instead, when I visite the URI that's supposed to be redirected, I just get a 404.

I've followed all the steps in the jekyll-redirect-from docs, including:

  • Adding jekyll-redirect-from to the Gemfile (code)
  • Adding it to my _config.yml file (code)
  • Adding the redirect_from key to my page's front matter (code)

I'm using jekyll 2.5.0 and jekyll-redirect-from 0.8.0 (the full gemfile is linked above). I'm building the project with bundler (using bundle exec jekyll serve), which is how the project's always been built.

Jekyll isn't showing any errors—the static file that should hold the redirect simply doesn't show up.

I can't for the life of me figure out the problem. Maybe I'm overlooking something obvious, or maybe there's some sort of subtle incompatibility in my dependencies?

1

1 Answers

2
votes

D'oh. The issue was that the safe option needed to be set to false for the plugin to run. This tripped me up because I know Github Pages sets safe to false as well, and yet jekyll-redirect-from generally runs there. But that appears to be because GH Pages has made an explicit exception to allow it.