rolandjesse.de/scripts/newpost
Jorge Arias 9972d927b9 Remove HTML chars '<' and '>' in generated post
This create problem in the rendering
2015-11-13 06:14:15 -03:00

13 lines
311 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')