Kristian Glass - Do I Smell Burning?

Mostly technical things

Permalinks

I just changed all the URLs of my blog posts.

Inspired by Matt Gemmell’s article on Permalinks, I’ve ditched the /year/month/day prefix, so e.g. the URL of this article is now http://blog.doismellburning.co.uk/permalinks/

Jekyll-wise it’s a matter of setting permalink appropriately in _config.yml:

1
permalink: /:title/

Handling the redirects was fun.

I use S3 for hosting. S3 supports web page redirections, and the AWS CLI makes this relatively straight-forward:

1
$ aws s3 cp --website-redirect /example-post {empty_file_path} s3://my-blog-bucket/1970/01/01/example-post/index.html

A little Python later, and I had a small script reading a CSV of (old_url, new_url) pairs and using this to establish the appropriate S3 links: https://gist.github.com/doismellburning/5a30b1304a602d191bed

Yay for eternal URLs!

Comments