tech, simplified.

Publish to Kirby from Alfred

Yesterday, I saw a tweet from the Kirby account that got me rather excited: there was a new Alfred 2 workflow for creating Kirby posts. This workflow, created by developer Marc Jenkins, let you turn a quick Alfred query into a folder for your post (with a iterated number for that folder) and made a plain text article file in that folder with the basic structure for an article.

It was great, but I wanted more. So, I took some time, and added some features to the initial workflow. I first set it to open the article file automatically, and then tweaked the iterated folder number so it wouldn't count my /feed/ folder in the number. I also changed it to use dashes instead of spaces in the new article folder name, since that's how I usually save my articles. Finally, I had it add the query to the Title: link in the new post file. That made it perfectly fit into how I blog with Kirby.

Now, I can open Alfred, type "post A New Post", and it'll make a new folder "XXX-A-New-Post" with an file in it that has the title "A New Post" and the current time, and that file will automatically open in my default writing app, iA Writer. Boom. That sure simplified blogging.

There's one extra thing I wanted, though. I also write link posts using Kirby's custom post types, and wanted an easy way to make those as well. With a few tweaks, I got it to make an file when I start the Alfred query with "postli", and it automatically adds the Link to the post file from my clipboard using pbpaste. I figured I'd need to copy the link anyhow, so that works out good. Now, to make a link post, I just copy the link, open Alfred, type "postli A New Link Post Name", and I'm ready to write.

It's been a fun little adventure into bash scripting in Alfred, and I'm sure I'll be using this little workflow a ton. Go check out my tweaked Alfred 2 workflow for new Kirby posts on Github if you'd like to use it with your own Kirby blog.

And a special thanks to Marc Jenkins for making the original Alfred workflow; I wouldn't have gotten started without his first version!

Thoughts? @reply me on Twitter.