Hacking Together a Blog Index (Squarespace)


Today in awkward, convoluted solutions, I bring you the way I generated an index of all of my posts on this site. This is not one of those “look at this cool workflow” posts. This is an ugly thing, which wouldn’t be necessary if Squarespace flipped a couple of bits.

Like the rest of the things on my Squarespace wishlist, it doesn’t look like it’s happening anytime soon. So I went ahead and hacked this together. Here’s how I did it:

  1. Exported the site to Wordpress format.

  2. Edited the resultant XML file in TextMate, using a bunch of Regex find-and-replace to strip out everything apart from the title, link and pubDate tags.

  3. Added the http://crateofpenguins.com part before every link.

  4. Changed title and link tags to markdown [title](link) format using find-and-replace.

  5. Converted Markdown to HTML and saved the file in Dropbox.

  6. Set up an IFTTT rule like this one which adds a new file in my Dropbox folder with post details every time a new post gets added to the site.

  7. Set up a Hazel rule which takes those IFTTT-generated files and prepends them to the main index file.

  8. Include jQuery in the header and then include the contents of this file in the page header as well.

  9. Add a code block to your page and put a div inside it with an ID of blogindex.

Easy.