Added newpost script
This commit is contained in:
parent
ab0389e1b8
commit
8b0d926494
2 changed files with 29 additions and 3 deletions
13
scripts/newpost
Executable file
13
scripts/newpost
Executable 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')
|
||||
Loading…
Add table
Add a link
Reference in a new issue