-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathRakefile
More file actions
31 lines (30 loc) · 842 Bytes
/
Rakefile
File metadata and controls
31 lines (30 loc) · 842 Bytes
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
require 'html/proofer'
task :test do
# Make sure there are no baseurls
sh 'echo "\n\nbaseurl:\nurl:" >> _config.yml'
begin
sh "bundle exec jekyll build"
rescue Exception => e
puts e.message
puts e.backtrace.inspect
# Remove empty baseurls
sh 'head -n -4 _config.yml > tmp && mv tmp _config.yml'
raise "build failed"
end
begin
HTML::Proofer.new("./_site", {
:disable_external => true,
:checks_to_ignore => ['ScriptCheck'],
:empty_alt_ignore => true,
:verbose => true,
:href_ignore => ["#"]
}).run
rescue Exception => e
puts e.message
puts e.backtrace.inspect
# Remove empty baseurls
sh 'head -n -4 _config.yml > tmp && mv tmp _config.yml'
end
# Remove empty baseurls
sh 'head -n -4 _config.yml > tmp && mv tmp _config.yml'
end