forked from ComputerScienceHouse/blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
58 lines (48 loc) · 1.49 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
require 'html-proofer'
$outputDir = "./_site"
$testOpts = {
# An array of Strings containing domains that will be treated as internal urls
:internal_domains => ["blog.csh.rit.edu"],
# Ignore errors "linking to internal hash # that does not exist"
:url_ignore => ["#"],
# Allow empty alt tags (e.g. alt="") as these represent presentational images
:empty_alt_ignore => true,
# Automatically add extension (e.g. .html) to file paths, to allow extensionless URLs
:assume_extension => true,
# LinkedIn blocks connections from html-proofer, ignore 999 error
:http_status_ignore => [999],
# SSL seems to be broken on TravisCI, so we'll ignore SSL errors.
:typhoeus => {
:ssl_verifypeer => 0,
:ssl_verifyhost => 0,
}
}
task :default => ["serve:development"]
desc "cleans the output directory"
task :clean do
sh "jekyll clean"
end
namespace :build do
desc "build development site"
task :development => [:clean] do
sh "jekyll build --drafts"
end
desc "build production site"
task :production => [:clean] do
sh "JEKYLL_ENV=production jekyll build --config=_config.yml"
end
end
namespace :serve do
desc "serve development site"
task :development => [:clean] do
sh "jekyll serve --drafts"
end
desc "serve production site"
task :production => [:clean] do
sh "JEKYLL_ENV=production jekyll serve --config=_config.yml"
end
end
desc "test production build"
task :test => ["build:production"] do
HTMLProofer.check_directory($outputDir, $testOpts).run
end