...
|
...
|
@@ -1,5 +1,6 @@
|
1
|
1
|
require "rubygems"
|
2
|
2
|
require "bundler/setup"
|
|
3
|
+require "stringex"
|
3
|
4
|
|
4
|
5
|
## -- Rsync Deploy config -- ##
|
5
|
6
|
# 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|
|
63
|
63
|
require './plugins/titlecase.rb'
|
64
|
64
|
args.with_defaults(:title => 'new-post')
|
65
|
65
|
title = args.title
|
66
|
|
- filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.downcase.gsub(/&/,'and').gsub(/[,'":\?!\(\)\[\]]/,'').gsub(/[\W\.]/, '-').gsub(/-+$/,'')}.#{new_post_ext}"
|
|
66
|
+ filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}"
|
67
|
67
|
puts "Creating new post: #{filename}"
|
68
|
68
|
open(filename, 'w') do |post|
|
69
|
69
|
system "mkdir -p #{source_dir}/#{posts_dir}";
|