Browse code

In new_post and new_page rake tasks: adding quotes around title attribute for better compatibility with yaml

Brandon Mathis authored on 19/07/2011 at 20:18:40
Showing 1 changed files
... ...
@@ -67,7 +67,7 @@ task :new_post, :title do |t, args|
67 67
     system "mkdir -p #{source_dir}/#{posts_dir}";
68 68
     post.puts "---"
69 69
     post.puts "layout: post"
70
-    post.puts "title: #{title.gsub(/&/,'&').titlecase}"
70
+    post.puts "title: \"#{title.gsub(/&/,'&').titlecase}\""
71 71
     post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
72 72
     post.puts "comments: true"
73 73
     post.puts "categories: "
... ...
@@ -92,7 +92,7 @@ task :new_page, :filename do |t, args|
92 92
     open(file, 'w') do |page|
93 93
       page.puts "---"
94 94
       page.puts "layout: page"
95
-      page.puts "title: #{name.gsub(/[-_]/, ' ').titlecase}"
95
+      page.puts "title: \"#{name.gsub(/[-_]/, ' ').titlecase}\""
96 96
       page.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
97 97
       page.puts "comments: true"
98 98
       page.puts "sharing: true"