-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
80 lines (68 loc) · 1.8 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
require 'haml'
haml_dir = "_haml"
layout_dir = "_layouts"
remote_server = "trixie"
remote_port = 2222
remote_dir = "/home/prs/web/"
site_address = "http://prsimp.com"
namespace :haml do
desc "Clean html layouts"
task :clean do
print "Deleting html layouts..."
system "rm -rf _layouts/*"
puts "done."
end
desc "Parse haml layouts"
task :parse => [:clean] do
print "Parsing haml layouts..."
Rake::FileList.new("#{haml_dir}/*.haml").each do |f|
# I should find a more elegant way to do this...
html_output = layout_dir + "/" + f.split("/")[1].sub(/haml/,'html')
File.open(html_output, 'w') do |output|
output.puts Haml::Engine.new(File.read(f), :format => :html5, :attr_wrapper => "\"").to_html
end
end
puts "done."
end
end
namespace :compass do
desc "Clean css files"
task :clean do
print "Cleaning css files..."
system "rm -rf css/*"
puts "done."
end
desc "Run compass in watch mode"
task :watch => [:clean] do
system "compass watch"
end
desc "Compile SCSS to css"
task :compile => [:clean] do
system "compass compile -s compact"
end
end
namespace :jekyll do
desc "Clean _site files"
task :clean do
print "Cleaning jekyll site files..."
system "rm -rf _site/*"
puts "done."
end
desc "Run jekyll in development mode"
task :server => [:clean, 'haml', 'compass'] do
puts "You must start compass watch in another terminal." # TODO
system "jekyll --auto --server"
end
desc "Generate site"
task :generate => [:clean, 'haml', 'compass'] do
system "jekyll"
end
end
task :haml => ['haml:parse']
task :compass => ['compass:compile']
task :jekyll => ['jekyll:generate']
task :dev => ['jekyll:server']
desc "Write new post"
task :post do
puts "Not implemented yet :("
end