Skip to content

Commit 6c4bbd9

Browse files
committed
Merge pull request #198 from parnmatt/patch-1
Remove empty quotes when category is empty.
2 parents 2f6c40b + a53b4a9 commit 6c4bbd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Rakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ task :post do
4747
title = ENV["title"] || "new-post"
4848
tags = ENV["tags"] || "[]"
4949
category = ENV["category"] || ""
50+
category = "\"#{category.gsub(/-/,' ')}\"" if !category.empty?
5051
slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
5152
begin
5253
date = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d')
@@ -65,7 +66,7 @@ task :post do
6566
post.puts "layout: post"
6667
post.puts "title: \"#{title.gsub(/-/,' ')}\""
6768
post.puts 'description: ""'
68-
post.puts "category: \"#{category.gsub(/-/,' ')}\""
69+
post.puts "category: #{category}"
6970
post.puts "tags: #{tags}"
7071
post.puts "---"
7172
post.puts "{% include JB/setup %}"

0 commit comments

Comments
 (0)