Static is the new dynamic
Dec 15, 2014Once again, I decided to move my blog over to a new home. Making use of the opportunity, I’ve switched technologies to what all the cool kids seem to be using: Jekyll, a Ruby application for generating static HTML sites.
By forking an existing theme, all the boilerplate was already taken care of. I picked Lanyon for its looks and simplicity, and managed to get a basic blog up and running in minutes – almost as advertised.
The resulting set-up is surprisingly functional! Using the built-in web server,
launched using the command jekyll serve
, you can easily preview local changes.
If you want to launch your browser as soon as Jekyll has launched, you can use
the following GNU Make rules (or extract the blob between define EXPECT_SERVE
and endef
, substituting double $
’s with single ones):
SHELL := /bin/bash
define EXPECT_SERVE
set timeout 5
spawn jekyll serve
expect {
-re {Server address:\s+(.+)$$} {
set address $$expect_out(1,string)
}
}
expect "Server running..."
catch {
exec xdg-open $$address
}
interact
endef
export EXPECT_SERVE
.PHONY: serve
serve:
expect <( echo "$$EXPECT_SERVE" )