Permalink
Browse files

Changed the rakefile so new_post generates a new post with the timest…

…amp in UTC.
  • Loading branch information...
jonorossi committed Nov 6, 2012
1 parent ae61954 commit 3573bc962fe38004c9d511d79892889431c8b073
Showing with 3 additions and 2 deletions.
  1. +3 −2 Rakefile
View
@@ -95,7 +95,8 @@ task :new_post, :title do |t, args|
mkdir_p "#{source_dir}/#{posts_dir}"
args.with_defaults(:title => 'new-post')
title = args.title
filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}"
post_time = Time.now.utc
filename = "#{source_dir}/#{posts_dir}/#{post_time.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}"
if File.exist?(filename)
abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
end
@@ -104,7 +105,7 @@ task :new_post, :title do |t, args|
post.puts "---"
post.puts "layout: post"
post.puts "title: \"#{title.gsub(/&/,'&')}\""
post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
post.puts "date: #{post_time.strftime('%Y-%m-%d %H:%M:%SZ')}"
post.puts "comments: true"
post.puts "categories: "
post.puts "---"

0 comments on commit 3573bc9

Please sign in to comment.