-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
25 lines (22 loc) · 642 Bytes
/
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
require "slim"
require "sassc"
namespace :compile do
desc "Compile Slim to HTML"
task :slim do
Dir.glob("src/**/*.slim").each do |file|
html = Slim::Template.new(file).render
File.write("dist/#{File.basename(file, ".slim")}.html", html)
puts "Compiled #{file} to HTML!"
end
end
desc "Compile Sass to CSS"
task :sass do
Dir.glob("src/**/*.scss").each do |file|
css = SassC::Engine.new(File.read(file)).render
File.write("dist/#{File.basename(file, ".scss")}.css", css)
puts "Compiled #{file} to CSS!"
end
end
desc "Compile Slim and Sass"
task :all => [ :slim, :sass ]
end