Skip to content

Instantly share code, notes, and snippets.

@mbaltaks
mbaltaks / newpost.rb
Created June 14, 2012 15:21 — forked from henrrrik/newpost.rb
Creates a new Jekyll post, opens it in MacVim, and adds to the git index
#!/usr/bin/env ruby
unless ARGV[0]
puts 'Usage: newpost "the post title"'
exit(-1)
end
blog_root = "/Users/henrik/Project/henrrrik.github.com"
date_prefix = Time.now.strftime("%Y-%m-%d")
postname = ARGV[0].strip.downcase.gsub(/ /, '-')