Photo Posts

I’ve wanted to add photography to my site for a long time, but never had a good way to add photo posts. It was always a chore to copy the file, resize it into multiple sizes, find the filenames and copy them where they needed to go, then create the post and add the image tags, link it all up, and finally push the update.

So I finally wrote a script to do it all for me.

For the impatient you can download the script here.


Install image magick, and if you’d like, create a folder action to automatically run the script every time a new file is dropped into it. This way you can just export photos to this “magic” folder, and you’ll instantly have a new photo post ready to go.

Install the script somewhere in your PATH. I put mine in /usr/local/bin.

Now, export a photo from Photos or Lightroom or wherever you’d like; just be sure you have a title and description set in your exif data.

The script runs and resizes the photo, copies the resized images into your _assets folder, and then creates a new post for the photo.

I’m using a this post template for my photo posts. Customize it to your liking, of course.

Updating your feed.xml and adding your own photography landing page are left as exercises for the reader.