Files
kcl-digital-humanities-garden/Rakefile
T

39 lines
748 B
Ruby
Raw Normal View History

2021-03-07 16:27:28 -05:00
# frozen_string_literal: true
require 'html-proofer'
task default: :check
desc 'Clean out _site'
task :clean do
sh 'rm -rf _site'
end
desc 'Preview site'
task watch: :clean do
2021-04-11 21:46:36 -04:00
sh 'bundle exec jekyll serve --watch'
2021-03-07 16:27:28 -05:00
end
desc 'Build site'
task build: :clean do
2021-04-11 21:46:36 -04:00
sh 'bundle exec jekyll build'
2021-03-07 16:27:28 -05:00
end
desc 'Run HTMLProofer on _site'
task check: :build do
options = {
check_html: true,
allow_hash_href: true,
assume_extension: true,
2021-04-11 21:46:36 -04:00
http_status_ignore: [403],
2021-03-07 16:27:28 -05:00
typhoeus: {
2021-04-18 20:41:21 -04:00
headers: {
2021-04-24 21:13:18 -04:00
"User-Agent": 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0'
2021-04-18 20:41:21 -04:00
},
"ssl_verifypeer": false,
"ssl_verifyhost": 0
2021-03-07 16:27:28 -05:00
}
}
HTMLProofer.check_directory('./_site', options).run
end