-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
63 lines (51 loc) · 1.46 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
## Remove the rakefile in favor of the newer Nanoc Commands, found in /commands
## Examples: http://www.remerson.plus.com/articles/nanoc-rake/
require 'nanoc/tasks'
# begin
# # Try to require the preresolved locked set of gems.
# require File.expand_path('../.bundle/environment', __FILE__)
# rescue LoadError
# # Fall back on doing an unlocked resolve at runtime.
# require "rubygems"
# require "bundler"
# Bundler.setup
# end
require 'fileutils'
%w{yaml}.each{|lib| require lib}
config = YAML.load(File.open("config.yaml"))
def path_tree(path,to_copy=[])
tree = []
raise "WHUT? Path empty!" if path.nil? || path.empty?
Dir.glob("#{path}/*").each do |path|
if File.directory?(path)
tree << path_tree(path)
else
tree << path
path_tree(path)
end
end
tree.flatten
end
desc "Watches and automatically compiles the site"
task :auto => :compile do
sh "nanoc auto --handler thin"
end
desc "Compile SCSS for main files & widgets into CSS"
task :compile_css do
puts "Compliling SCSS into CSS"
# compile the sites main CSS
sh "compass compile --output-style compressed --force"
# compiles the CSS for past site versions
end
desc "Compile static files"
task :compile do
puts "Compiling content."
sh "nanoc compile"
end
task :sync do
puts "Syncing site to remote home directory"
# sh "rsync ... -r --force -v -v"
end
task :build => [:compile_css, :compile]
task :deploy => [:build, :sync]
task :default => :deploy