This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Begin a new post in #{source_dir}/#{posts_dir}" | |
task :new_post, :title do |t, args| | |
if args.title | |
title = args.title | |
else | |
title = get_stdin("Enter a title for your post: ") | |
end | |
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir) | |
mkdir_p "#{source_dir}/#{posts_dir}" | |
filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}" |
NewerOlder