Merge branch 'master' into site

This commit is contained in:
Brandon Mathis 2011-08-25 10:11:02 -04:00
commit cfff0a2481
2 changed files with 38 additions and 14 deletions

View File

@ -6,5 +6,5 @@
<time datetime="{{ date | datetime }}" pubdate {% if updated %} updated {% endif %}>{{ date | ordinalize }}</time>
{% endif %}
{% if was_updated != '0' %}
<time class="updated" datetime="{{ updated | datetime }}"></time>
<time class="updated" datetime="{{ updated | datetime }}">{{ updated | ordinalize }}</time>
{% endif %}

View File

@ -50,12 +50,34 @@ end
desc "Watch the site and regenerate when it changes"
task :watch do
system "trap 'kill $jekyllPid $compassPid' Exit; jekyll --auto & jekyllPid=$!; compass watch & compassPid=$!; wait"
puts "Starting to watch source with Jekyll and Compass."
jekyllPid = spawn("jekyll --auto")
compassPid = spawn("compass watch")
trap("INT") {
Process.kill(9, jekyllPid)
Process.kill(9, compassPid)
exit 0
}
Process.wait
end
desc "preview the site in a web browser"
task :preview do
system "trap 'kill $jekyllPid $compassPid $rackPid' Exit; jekyll --auto & jekyllPid=$!; compass watch & compassPid=$!; rackup --port #{server_port} & rackPid=$!; wait"
puts "Starting to watch source with Jekyll and Compass. Starting Rack on port #{server_port}"
jekyllPid = spawn("jekyll --auto")
compassPid = spawn("compass watch")
rackupPid = spawn("rackup --port #{server_port}")
trap("INT") {
Process.kill(9, jekyllPid)
Process.kill(9, compassPid)
Process.kill(9, rackupPid)
exit 0
}
Process.wait
end
# usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post")
@ -125,7 +147,7 @@ end
desc "Clean out caches: _code_cache, _gist_cache, .sass-cache"
task :clean do
system "rm -rf _code_cache/** _gist_cache/** .sass-cache/** source/stylesheets/screen.css"
rm_rf ["_code_cache/**", "_gist_cache/**", ".sass-cache/**", "source/stylesheets/screen.css"]
end
desc "Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/custom"
@ -133,11 +155,12 @@ task :update_style, :theme do |t, args|
theme = args.theme || 'classic'
if File.directory?("sass.old")
puts "removed existing sass.old directory"
system "rm -r sass.old"
rm_r "sass.old", :secure=>true
end
system "mv sass sass.old"
mv "sass", "sass.old"
puts "## Moved styles into sass.old/"
system "mkdir -p sass; cp -R #{themes_dir}/"+theme+"/sass/ sass/"
mkdir_p "sass"
cp_r "#{themes_dir}/"+theme+"/sass/", "sass"
cp_r "sass.old/custom/.", "sass/custom"
puts "## Updated Sass ##"
end
@ -147,15 +170,16 @@ task :update_source, :theme do |t, args|
theme = args.theme || 'classic'
if File.directory?("#{source_dir}.old")
puts "removed existing #{source_dir}.old directory"
system "rm -r #{source_dir}.old"
rm_r "#{source_dir}.old", :secure=>true
end
system "mv #{source_dir} #{source_dir}.old"
mv source_dir, "#{source_dir}.old"
puts "moved #{source_dir} into #{source_dir}.old/"
system "mkdir -p #{source_dir}; cp -R #{themes_dir}/"+theme+"/source/. #{source_dir}"
system "cp -Rn #{source_dir}.old/. #{source_dir}"
system "cp -Rf #{source_dir}.old/_includes/custom/. #{source_dir}/_includes/custom/"
system "mv -f #{source_dir}/index.html #{blog_index_dir}" if blog_index_dir != source_dir
system "cp -f #{source_dir}.old/index.html #{source_dir}" if blog_index_dir != source_dir
mkdir_p source_dir
cp_r "#{themes_dir}/"+theme+"/source/.", source_dir
cp_r "#{source_dir}.old/.", source_dir, :preserve=>true
cp_r "#{source_dir}.old/_includes/custom/.", "#{source_dir}/_includes/custom/"
mv "#{source_dir}/index.html", "#{blog_index_dir}", :force=>true if blog_index_dir != source_dir
cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir
puts "## Updated #{source_dir} ##"
end