Skip to content

Commit

Permalink
improved starting point
Browse files Browse the repository at this point in the history
  • Loading branch information
imathis committed Oct 19, 2009
1 parent 2b4c594 commit 82d0251
Show file tree
Hide file tree
Showing 12 changed files with 839 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
site
63 changes: 63 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
require 'active_support'

def ok_failed(condition)
if (condition)
puts "OK"
else
puts "FAILED"
end
end

port = "4000"
site = "site"

desc "list tasks"
task :default do
puts "Tasks: #{(Rake::Task.tasks - [Rake::Task[:default]]).to_sentence}"
puts "(type rake -T for more detail)\n\n"
end

desc "remove files in output directory"
task :clean do
puts "Removing output..."
Dir["#{site}/*"].each { |f| rm_rf(f) }
end

desc "generate website in output directory"
task :generate => :clean do
puts "Generating website..."
system "compass"
system "jekyll"
Dir["#{site}/stylesheets/*.sass"].each { |f| rm_rf(f) }
system "mv #{site}/atom.html #{site}/blog/atom.xml"
end

desc "generate and deploy website"
task :deploy => :generate do
print "Deploying website..."
ok_failed system("rsync -avz --delete #{site}/ [email protected]:~/document_root/")
end

desc "start up an instance of serve on the output files"
task :start_serve => :stop_serve do
cd "#{site}" do
print "Starting serve..."
ok_failed system("serve #{port} > /dev/null 2>&1 &")
end
end

desc "stop all instances of serve"
task :stop_serve do
pid = `ps auxw | awk '/bin\\/serve\\ #{port}/ { print $2 }'`.strip
if pid.empty?
puts "Serve is not running"
else
print "Stoping serve..."
ok_failed system("kill -9 #{pid}")
end
end

desc "preview the site in a web browser"
multitask :preview => [:generate, :start_serve] do
system "open http://localhost:#{port}"
end
6 changes: 3 additions & 3 deletions source/_config.yml → _config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
source: .
destination: ../site
source: source
destination: site
markdown: rdiscount
pygments: true
permalink: /blog/:year/:month/:day/:title
url:
url: http://yoursite.com
multiviews: true
sass: false
haml: true
Expand Down
10 changes: 10 additions & 0 deletions config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Require any additional compass plugins here.
project_type = :stand_alone
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "_site/stylesheets"
sass_dir = "_source/stylesheets"
images_dir = "images"

# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
Loading

0 comments on commit 82d0251

Please sign in to comment.