-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
49 lines (40 loc) · 1014 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# coding: utf-8
require 'jekyll'
# Extend string to allow for bold text.
class String
def bold
"\033[1m#{self}\033[0m"
end
end
# Rake Jekyll tasks
task :build do
conf = Jekyll.configuration({
'source' => 'test/jekyll-material-icon-tag',
'destination' => './_site/',
'verbose' => false,
'quiet' => true
})
puts 'Building site...'.bold
Jekyll::Commands::Build.process(conf)
end
task :clean do
puts 'Cleaning up _site...'.bold
Jekyll::Commands::Clean.process({})
end
# Test generated output has valid HTML and links.
task :test => :build do
File.open("_site/index.html") do |file|
content = file.read
if content.include? "{% icon"
raise "Hell"
end
unless content.include? "material-icons-two-tone"
raise "Hell of two tones"
end
unless content.include? "material-icons-two-tone"
raise "Hell of two tones"
end
file.close
end
end
task :default => ["build"]