New Post script
I recently began working with Jekyll, and I love it. It’s the elusive Goldilocks blend of technical vs non-so, Convention Over Configuration vs The Other Way Around. I’ve liked it so much that I’ve even installed a Sublime Text package called MarkdownEditing which I now use for all my writing (it’s so pretty!).
However, I’m not a big fan of the process of writing a new post. Just too much unnecessary work - what with naming with dates and adding YAML Front Matter - that can and should be automated. So I wrote a little script that did that. Check it out on GitHub!
You can either run the new_post script as it is and a new post with the title ‘new post’ will be generated (with the date and filename being handled for you), or you could specify a file name by passing it as an argument thusly:
./new_post "Your filename here"
When you specify a filename, the script auto-generates the Markdown text file in the _posts directory in the correct Jekyll post format and the title in the name is manufactured from the provided filename.
# Example: ./new_post "Hello there, World!" # ... would create and open for editing: 2014-12-26-hello-there-world.md
The YAML Front Matter is auto-generated with the title being set to be the filename you provided as-is, and after the script executes you are navigated to the correctly set-up text file for writing (on vim; you could set that to be something else in the script). Let me know what you think!
UPDATE: Now featuring support for Disqus. Appends the “comments: True” in the YAML Front Matter.