File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,13 @@ module JB
40
40
end #Path
41
41
end #JB
42
42
43
- # Usage: rake post title="A Title" [date="2012-02-09"] [tags=[tag1, tag2]]
43
+ # Usage: rake post title="A Title" [date="2012-02-09"] [tags=[tag1,tag2]] [category="category" ]
44
44
desc "Begin a new post in #{ CONFIG [ 'posts' ] } "
45
45
task :post do
46
46
abort ( "rake aborted: '#{ CONFIG [ 'posts' ] } ' directory not found." ) unless FileTest . directory? ( CONFIG [ 'posts' ] )
47
47
title = ENV [ "title" ] || "new-post"
48
48
tags = ENV [ "tags" ] || "[]"
49
+ category = ENV [ "category" ] || ""
49
50
slug = title . downcase . strip . gsub ( ' ' , '-' ) . gsub ( /[^\w -]/ , '' )
50
51
begin
51
52
date = ( ENV [ 'date' ] ? Time . parse ( ENV [ 'date' ] ) : Time . now ) . strftime ( '%Y-%m-%d' )
@@ -64,7 +65,7 @@ task :post do
64
65
post . puts "layout: post"
65
66
post . puts "title: \" #{ title . gsub ( /-/ , ' ' ) } \" "
66
67
post . puts 'description: ""'
67
- post . puts "category: "
68
+ post . puts "category: \" #{ category . gsub ( /-/ , ' ' ) } \" "
68
69
post . puts "tags: #{ tags } "
69
70
post . puts "---"
70
71
post . puts "{% include JB/setup %}"
You can’t perform that action at this time.
0 commit comments