File tree 1 file changed +29
-12
lines changed
1 file changed +29
-12
lines changed Original file line number Diff line number Diff line change 1
1
require 'html-proofer'
2
+ require 'jekyll'
2
3
3
- desc 'Clean up generated site'
4
+ Rake . application . options . trace = true
5
+
6
+ desc 'Remove all generated files: destination folder, metadata file, Sass and Jekyll caches.'
4
7
task :clean do
5
- sh 'rm -rf _site'
8
+ Jekyll ::Commands ::Clean . process ( { } )
9
+ end
10
+
11
+ desc 'Build and serve the site'
12
+ task serve : [ :build ] do
13
+ Jekyll ::Commands ::Serve . process ( { } )
14
+ end
15
+
16
+ desc 'Build the site'
17
+ task build : [ :clean ] do
18
+ Jekyll ::Commands ::Build . process ( { } )
6
19
end
7
20
8
- task :test do
9
- sh 'bundle exec jekyll build'
10
- HTMLProofer . check_directories (
11
- [ "./_site" ] , {
12
- :empty_alt_ignore => false ,
13
- typhoeus : {
14
- headers : {
15
- "Accept-Encoding" => "gzip" ,
16
- }
21
+ desc 'Build and test the site'
22
+ task test : [ :build ] do
23
+ options = {
24
+ :check_html => true , # Validate HTML
25
+ :empty_alt_ignore => false , # Allow images with empty alt tags
26
+ :check_favicon => true , # Check whether favicons are valid
27
+ :check_img_http => true , # Enforce that images use HTTPS
28
+ typhoeus : {
29
+ headers : {
30
+ # This is required to validate links to docs.github.com
31
+ "Accept-Encoding" => "gzip" ,
17
32
}
18
- } ) . run
33
+ }
34
+ }
35
+ HTMLProofer . check_directory ( "./_site" , options ) . run
19
36
end
20
37
21
38
task default : :test
You can’t perform that action at this time.
0 commit comments