Home Jekyll-Bootstrap themes and GitHub Pages
Post
Cancel

Jekyll-Bootstrap themes and GitHub Pages

UPDATE: This site has since been switched to the elegant theme by the name of Chirpy.

After setting up jekyll-bootstrap and playing with it for a while, I decided to try and set up a custom theme by following the official instructions. Several themes are conveniently available at themes.jekyllbootstrap.com, including the theme you’re looking at right now. But did it work out of the box? No. Of course not.

After running rake theme:install git="https://github.com/dhulihan/hooligan.git" and switching to the newly installed theme, I tried to push to GitHub. Unfortunately, five minutes later, I received the following email:

1
2
3
4
5
6
7
The page build failed with the following error:

The submodule `_theme_packages/hooligan` was not properly initialized with a `.gitmodules` file.

For information on troubleshooting Jekyll see:

  https://help.github.com/articles/using-jekyll-with-pages#troubleshooting

Of course, looking at the troubleshooting page didn’t help. The issue seemed to be that the above command adds a new git submodule to _theme_packages/hooligan but does not create the .gitmodules file. The solution was simple, although annoyingly undocumented: add the _theme_packages folder to .gitignore.

Since the folder in question was already in the repo, I had to remove it:

1
git rm -r --cached _theme_packages

Then simply edit your .gitignore and add the _theme_packages folder:

1
2
3
*.swp
_site
_theme_packages

Finally, commit and push to GitHub and you should be done. I’m not sure whether this is the correct way to resolve the issue, it looks like this may be a bug in jekyll-bootstrap.

This post is licensed under CC BY 4.0 by the author.