This is a really simple python script to easily create a new post for Jekyll.
It takes one argument, the post name, and gives you a new file in your _posts
directory.
To use it, call python new_post.py "name of post"
It will generate _posts/[year]/[month]/[year]-[month]-[day]-name-of-post.md
, which will look like this:
---
title: [argument from call]
layout: [layout - it's a variable in the new_post file, set to default]
date: [current date and time in yyyy-mm-dd hh:mm:00 [timezone] format, timezone is another variable, set to -0600, or central time]
published: false
---
Pretty simple, but that's all that I really wanted.
Update 31 December 2011
I made a minor tweak, simply because I started noticing my _posts
directory was getting a little unmanageable. The new version uses year and month folders to keep things a little more organized, and jekyll knows how that works, which is nice too.
Update 1 January 2012
Okay, so the last version didn't make directories if they didn't exist. It does now.