Added newpost script

This commit is contained in:
Panos Sakkos 2015-10-18 21:17:55 +02:00
parent ab0389e1b8
commit 8b0d926494
2 changed files with 29 additions and 3 deletions

13
scripts/newpost Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/ruby
require 'date'
POSTS_DIR = '_posts/'
post = ARGV[0]
File.open(POSTS_DIR + Date.today.strftime("%Y-%m-%d-") + post + '.markup', 'w') {|f| f.write(
"---\nlayout: post\nsection-type: post\ntitle: <Title>\ncategory: <Category>\ntags: [ '<tag1>', '<tag2>' ]\n---")
}
puts('[+] Created ' + post + ' post')