Jekyll on Bitbucket

I’m an obstinate old fool; while the cool kids are on GitHub I wanted to stay with BitBucket (it’s not so much the site - I’m more familiar with Mercurial and don’t want to be messing with bridges). At the same time, I’m throwing this together one evening, and want results quickly. So I want to use Jekyll.

Luckily, it turns out that Bitbucket can serve static sites. This is pretty much the same as deploying static sites on GitHub except that, as far as I can tell, there’s no way to tie Jekyll to a post-update hook on the server. Instead, we need to generate the site on the client and then send that to Bitbucket.

That raises one more issue - Bitbucket serves static data from the root directory of a repo and Jekyll completely wipes the destination directory. So you can’t have the site in the same repo that contains your Jekyll files (since Jekyll will wipe them!) Instead, we use two repos (hey - they’re unlimited). One, with the magic name (see the Bitbucket support link above), for the generated site, and one for the Jekyll source. We still generate the site in _site (targetting the site repo would have Jekyll deleting .hg), but then copy everything across with a simple shell script.

You can see all the details in the code.

Finally, if you work at ISTI and want to post, here’s what you do:

Andrew

PS Some useful links for use with Jekyll:


Related Posts

blog comments powered by