DEV Community

loading...

Using Cobalt with GitHub pages

booyaa profile image Mark Sta Ana Originally published at booyaa.wtf on ・1 min read

It turns out using Cobalt and your personal GitHub page is a bit trickier to setup. Your personal GitHub page as oppose to your repo GitHub page, must have the content in the master branch. Repository/Project GitHub pages can live in a subdir of default branch i.e. docs

This is not a criticism of Cobalt, but rather myself demonstrating my lack of git prowess.

The general gist of this how to, is that you place your Cobalt project in the source branch and then use cobalt import --branch master to transfer the rendered content to master.

Instructions

  • Create your user/personal page repo (USERNAME.github.io)
  • Follow instructions for initialising a repo
git checkout -b source
cobalt init
# do cobalty stuff..
cobalt build
# commit, maybe even push to source
cobalt import --branch master
git checkout master
# commit, definitely push

If you want to check out my setup you can find it here.

Things I've not worked out yet

  • The build folder gets copied to the master branch during cobalt import. The folder doesn't contain any files. My work around at the moment is to add it to .gitignore in the master branch.

Thanks to...

  • Johann Hofmann for allowing me to copy his blog's style (and his travis-ci auto deploy setup).
  • Cobalt for creating this easy to use static site generator.

Discussion (1)

pic
Editor guide
Collapse
Sloan, the sloth mascot
Comment deleted