Just completely yoink @envygeeks' changes

From https://github.com/jekyll/jekyll/pull/1213.

I cannot emphasize how much this is not my code. This is all @envygeeks! But unfortunately, since his fork was deleted, I'm unable to cherry-pick the git commits. I'm not sure if the previous branch exists locally for him, so I'm making this PR to get the changes moving along.