rolandjesse.de/scripts/newpost
Panos Sakkos b0a8b934d2 Updated documentation and newpost script
.markup was deprecated by jekyll and all the post files have to have an
md file ending.
2015-11-01 02:34:29 +01:00

13 lines
319 B
Ruby
Executable file

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