Setting up Nikloa for Personal Github Sites
After a bit of a struggle I finally moved my personal Github site over from Jekyll to Nikola. I'm documenting what I did here for my future self and in case it's useful to anyone else.
Github setup
- Create
sourcebranch in addition tomaster, all of the Nickola stuff will happen here. Themasterbranch is where the static site will be served from and the output fromnikola buildwill be put there usingghp-import. - Checkout the
sourcebranch and initialize your Nikola site (see Nikola getting started) - You can now do all the things you need to do with Nikola (pages, posts, theme, etc.)
Syncing site
I am having trouble getting nikola github_deploy working with my setup (Python 3.4, Window 7, in a virtualenv) so here is how I am doing it manually.
- Make sure
ghp-importis installed- If you are getting
TypeError: Type str doesn't support the buffer APIcheck here for the fix.
- If you are getting
- Use
ghp-import.py -n -b master output, this will- Update the
masterbranch with what's in./output/ - Include a
.nojekyllfile to signal to Github thatmasteris not Jekyll based
- Update the
- If you can use
nikola deployyou will probably need to edit the following:
GITHUB_SOURCE_BRANCH = 'source' # changed from 'master' GITHUB_DEPLOY_BRANCH = 'master' # changed from 'gh-pages'
Thanks to John Foster and his johntfoster.github.io repository for the example.