Jekyll on App Engine with beautiful URLs

For my project Waterglass I host a static Jekyll blog on Google App Engine. And of course I want beautiful URLs like /blog/8-cat-pics-that-made-me-smile – but that’s not as automatic on App Engine as on other servers. So here is how you do it.

The url line contains a regex which has two groups. The first matches the year (four digits) and the second matches the remaining characters. In static_files we use these two groups (\1 and \2) to construct the path to the index.html we want to return when someone hits a matching URL. upload finally tells App Engine which files to upload to the server – in our example everything inside the blog directory.

Now you should also add a handler for /blog – which is really straightforward.