-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Rakefile
53 lines (42 loc) · 1.23 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
require 'html-proofer'
$outputDir = "_site"
$serveOpts = "--host 0.0.0.0 --port 4000"
$testOpts = {
# 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,
:assume_extension => true,
}
task :default => ["serve:development"]
desc "cleans the output directory"
task :clean do
#sh "rm -rf .asset-cache"
sh "bundle exec jekyll clean"
end
namespace :build do
desc "build development site"
task :development => [:clean] do
sh "bundle exec jekyll build"
end
desc "build production site"
task :production => [:clean] do
sh "JEKYLL_ENV=production bundle exec jekyll build --destination #{$outputDir}"
end
end
namespace :serve do
desc "serve development site"
task :development => [:clean] do
sh "bundle exec jekyll serve #{$serveOpts}"
end
desc "serve production site"
task :production => [:clean] do
sh "JEKYLL_ENV=production bundle exec jekyll serve #{$serveOpts} --destination #{$outputDir}"
end
end
namespace :test do
desc "test production build"
task :production => ["build:production"] do
HTMLProofer.check_directory($outputDir, $testOpts).run
end
end