Skip to content

Commit

Permalink
Add rake task to create a new release post.
Browse files Browse the repository at this point in the history
Adds all the necessary metadata and add two newlines at the
top of the post to start with.
  • Loading branch information
parkr committed Aug 10, 2013
1 parent b3e3d8a commit d452135
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Rakefile
Expand Up @@ -202,6 +202,30 @@ namespace :site do
abort "You seem to have misplaced your History.markdown file. I can haz?"
end
end

namespace :releases do
desc "Create new release post"
task :new, :version do |t, args|
raise "Specify a version: rake site:releases:new['1.2.3']" unless args.version
today = Time.new.strftime('%Y-%m-%d')
filename = "site/_posts/#{today}-jekyll-#{release.split('.').join('-')}-released.markdown"

File.open(filename, "wb") do |post|
post.puts("---")
post.puts("layout: news_item")
post.puts("title: 'Jekyll #{release} Released'")
post.puts("date: #{Time.new.strftime('%Y-%m-%d %H:%M:%S %z')}")
post.puts("author: ")
post.puts("version: #{version}")
post.puts("categories: [release]")
post.puts("---")
post.puts
post.puts
end

puts "Created #{filename}"
end
end
end

#############################################################################
Expand Down

0 comments on commit d452135

Please sign in to comment.