diff --git a/Rakefile b/Rakefile index 176c94b..f8f470b 100644 --- a/Rakefile +++ b/Rakefile @@ -47,6 +47,7 @@ task :post do title = ENV["title"] || "new-post" tags = ENV["tags"] || "[]" category = ENV["category"] || "" + category = category.empty? ? "" : "\"#{category.gsub(/-/,' ')}\"" slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '') begin date = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d') @@ -65,7 +66,7 @@ task :post do post.puts "layout: post" post.puts "title: \"#{title.gsub(/-/,' ')}\"" post.puts 'description: ""' - post.puts "category: \"#{category.gsub(/-/,' ')}\"" + post.puts "category: #{category}" post.puts "tags: #{tags}" post.puts "---" post.puts "{% include JB/setup %}"