diff options
author | Pavel Pravosud <rwz@duckroll.ru> | 2011-08-20 10:24:15 +0700 |
---|---|---|
committer | Pavel Pravosud <rwz@duckroll.ru> | 2011-08-20 10:24:15 +0700 |
commit | 5ec1f014a0d828fe3d555600b527d7201fbf4d97 (patch) | |
tree | 0a962d6bdb026bc3a4c6b85cc63da57d92181023 /Rakefile | |
parent | 178a198ea7f932307bbe2affeba10240a3168ff3 (diff) | |
download | my_new_personal_website-5ec1f014a0d828fe3d555600b527d7201fbf4d97.tar.xz my_new_personal_website-5ec1f014a0d828fe3d555600b527d7201fbf4d97.zip |
added stringex gem for permalink url generation
Diffstat (limited to '')
-rw-r--r-- | Rakefile | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,5 +1,6 @@ require "rubygems" require "bundler/setup" +require "stringex" ## -- Rsync Deploy config -- ## # Be sure your public key is listed in your server's ~/.ssh/authorized_keys file @@ -63,7 +64,7 @@ task :new_post, :title do |t, args| require './plugins/titlecase.rb' args.with_defaults(:title => 'new-post') title = args.title - filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.downcase.gsub(/&/,'and').gsub(/[,'":\?!\(\)\[\]]/,'').gsub(/[\W\.]/, '-').gsub(/-+$/,'')}.#{new_post_ext}" + filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}" puts "Creating new post: #{filename}" open(filename, 'w') do |post| system "mkdir -p #{source_dir}/#{posts_dir}"; |