DEV Community

Mark Sta Ana
Mark Sta Ana

Posted on • Originally published at booyaa.wtf on

2 3

Using Cobalt with GitHub pages

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
Enter fullscreen mode Exit fullscreen mode

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.

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (1)

Collapse
 
Sloan, the sloth mascot
Comment deleted

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay