-
Notifications
You must be signed in to change notification settings - Fork 4.4k
/
Rakefile
38 lines (32 loc) · 951 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
require 'html-proofer'
require 'jekyll'
Rake.application.options.trace = true
desc 'Remove all generated files: destination folder, metadata file, Sass and Jekyll caches.'
task :clean do
Jekyll::Commands::Clean.process({})
end
desc 'Build and serve the site'
task serve: [:build] do
Jekyll::Commands::Serve.process({})
end
desc 'Build the site'
task build: [:clean] do
Jekyll::Commands::Build.process({})
end
desc 'Build and test the site'
task test: [:build] do
options = {
:check_html => true, # Validate HTML
:empty_alt_ignore => false, # Allow images with empty alt tags
:check_favicon => true, # Check whether favicons are valid
:check_img_http => true, # Enforce that images use HTTPS
typhoeus: {
headers: {
# This is required to validate links to docs.github.com
"Accept-Encoding" => "gzip",
}
}
}
HTMLProofer.check_directory("./_site", options).run
end
task default: :test