There’s always another yak that needs shaving. Since creating posts with WWW::StaticBlog wasn’t fast enough for my tastes, I made a small script to make it even faster!
Before, I would create the directory hirarchy, if I haven’t yet made a post this month, coming up with a file name that has some relavence to the post contents, but is still sane for a file name, and opening it up in the editor, creating the
Author: “headers”, and finally getting down to writing the silly post.
By saving this as
~/bin/git-new-post, I automatically get a new Git command. Now, I can just type
git new-post from my site’s repository, and I’ll be prompted for the post’s title (with readline support), and the directories will be created for me, the title will be sanitized into a reasonable file name, the empty post with just the headers will be added to Git, and the file will be opened up in vim, with the cursor at the end, ready for me to just start writing.
Optionally, I can provide the title to new-post with
git new-post Some title, and it won’t bother prompting me.