Jekyll Archives is a great gem, but GitHub Pages chose not to support it:

I don’t believe this fits into the Pages roadmap right now. The plugin is high-touch, in relation to the file system, and is relatively large, for a Jekyll plugin, which creates a significant burden on our security team to review on each bump.

That’s actually very understandable. I don’t disagree with this rejection. If I were on the GitHub Pages team, I might be tempted to make the same judgement call for the same reasons, despite the heavy pushback that the community gave against the decision. Regardless, this is where we’re at, and it makes a great reason why you might want to use a different process to build your Jekyll site other than GitHub’s instance of Jekyll.

The idea is fairly simple:

  1. You write your Jekyll posts locally like you always have, and push them to the master branch of your GitHub repo.
  2. This triggers a script on a service like CodeShip, CircleCI, or Travis. The script does a Jekyll build of the site using GitHub-forbidden gems such as the jekyll-archive one. Then it pushes this static build as a commit to your gh-pages branch on the GitHub repo.

This process is actually very similar to my piece on auto-deploying to gh-pages with Codeship, but I’ll go through it here again since the script is slightly different. It’s not nearly as complicated as you might think.

  1. Create a Codeship account and authorize a new project with your GitHub repo.
  2. I recommend that you use a machine user GitHub account but you can use your primary one if you'd rather. The main reason I prefer a machine user is that this user is going to be creating some commits and they're really bogus commits. If you use your main account, they'll show up in your profile's contribution timeline. I like my timeline to be clean and only show commits that I actually made, not those of an automated script somewhere.
  3. Back in Codeship, specify this script as the deployment script.
git  clone [email protected]:<your main github account>/<your repo name>.git _site
cd _site
git checkout gh-pages || git checkout --orphan gh-pages
cd ..
rm -rf _site/**/* || exit 0
bundle install
bundle exec jekyll build
cd _site
rm Gemfile Gemfile.lock readme.md
git config user.email "<your machine account github email>"
git config user.name "<your machine account github username>"
git add -A .
git commit -m "Deploy to GitHub Pages: ${CI_COMMIT_ID} --skip-ci"
git push origin gh-pages
  1. Delete your gh-pages branch from GitHub. Make master the default branch if it wasn't already. This will take your site down if you stop here, so do the next step immediately.
  2. Push to your master branch, or run the Codeship build process manually if you have no local changes that need pushing.

With this setup, you are no longer dependent on what gems GitHub allows or disallows. Anything that’s possible with vanilla Jekyll is now possible with GitHub Pages.