-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
81 lines (75 loc) · 2.05 KB
/
Rakefile
File metadata and controls
81 lines (75 loc) · 2.05 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# frozen_string_literal: true
abort('Please run this using `bundle exec rake`') unless ENV['BUNDLE_BIN_PATH']
require 'html-proofer'
require 'rubocop/rake_task'
desc 'run rubocop'
task :rubocop do
RuboCop::RakeTask.new
rescue StandardError => e
puts e
end
desc 'build site'
task :build do
# using --unpublished or --future disables --drafts
sh 'JEKYLL_ENV="production" bundle exec jekyll build --strict_front_matter --unpublished --future'
rescue StandardError => e
puts e
end
desc 'run vnu validator'
task vnu: :build do
sh 'vnu --skip-non-html --also-check-css --also-check-svg --format text _site'
rescue StandardError => e
puts e
end
desc 'verify links'
task test: :build do
options = {
typhoeus:
{
connecttimeout: 60,
timeout: 300
},
check_external_hash: true,
check_internal_hash: true,
check_favicon: true,
check_opengraph: true,
check_html: true,
check_img_http: true,
check_sri: true,
validation: {
report_eof_tags: true,
report_invalid_tags: true,
report_mismatched_tags: true,
report_missing_doctype: true,
report_missing_names: true,
report_script_embeds: true
},
cache: {
timeframe: {
internal: '1d',
external: '1d'
}
},
enforce_https: false,
ignore_status_codes: [403, 429, 503, 999],
ignore_urls: [
# URL not resolving
'https://mngts.egnyte.com/fl/t2g1wNfsG3',
# URLs time out
'https://education.rstudio.com/learn/beginner/',
# URLs require authentication
'https://groups.google.com/forum/#!msg/sira-public/T17qkvbwNhA/J42QjxbHAAAJ',
'https://societyinforisk.org/SiRAcon-20#LR220',
'https://societyinforisk.org/page-18117#Benninghoff21',
'https://societyinforisk.org/page-18130#Benninghoff22',
'https://societyinforisk.org/siracon19#elliotnotebooks',
'https://societyinforisk.org/siracon23#jb23'
]
}
begin
HTMLProofer.check_directory('./_site', options).run
rescue StandardError => e
puts e
end
end
task default: %i[rubocop test]