kcl-digital-humanities-garden/Rakefile

39 lines
748 B
Ruby
Raw Normal View History

2021-03-07 21:27:28 +00: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-12 01:46:36 +00:00
sh 'bundle exec jekyll serve --watch'
2021-03-07 21:27:28 +00:00
end
desc 'Build site'
task build: :clean do
2021-04-12 01:46:36 +00:00
sh 'bundle exec jekyll build'
2021-03-07 21:27:28 +00:00
end
desc 'Run HTMLProofer on _site'
task check: :build do
options = {
check_html: true,
allow_hash_href: true,
assume_extension: true,
2021-04-12 01:46:36 +00:00
http_status_ignore: [403],
2021-03-07 21:27:28 +00:00
typhoeus: {
2021-04-19 00:41:21 +00:00
headers: {
2021-04-25 01:13:18 +00:00
"User-Agent": 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0'
2021-04-19 00:41:21 +00:00
},
"ssl_verifypeer": false,
"ssl_verifyhost": 0
2021-03-07 21:27:28 +00:00
}
}
HTMLProofer.check_directory('./_site', options).run
end