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 Title:, and Author: “headers”, and
finally getting down to writing the silly post.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
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.