2021-07-16 19:16:30 +08:00
|
|
|
# Rakefile taken from:
|
|
|
|
# https://seankilleen.com/2019/09/how-to-check-your-jekyll-based-blog-for-dead-links/
|
|
|
|
|
|
|
|
# Ensures we have the html-proofer library available to use
|
|
|
|
require 'html-proofer'
|
|
|
|
|
|
|
|
# The function that will run the proofer, so that we can re-use it between our two rake tasks
|
|
|
|
def run_htmlproofer()
|
|
|
|
options = {
|
|
|
|
# Assumes html file extensions
|
|
|
|
assume_extension: true,
|
2021-07-16 20:12:08 +08:00
|
|
|
|
|
|
|
file_ignore: [ /stabilizer\/firmware\/.*/ ],
|
|
|
|
|
2021-07-16 19:16:30 +08:00
|
|
|
# The options for the curl library that's used.
|
|
|
|
:typhoeus => {
|
|
|
|
# This will stop you from getting errors when certs can't be parsed, which doesn't matter in this case.
|
|
|
|
:ssl_verifypeer => false
|
|
|
|
},
|
|
|
|
# Won't fail for local links
|
|
|
|
allow_hash_href: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
# Calls html-proofer and uses the Jekyll _site folder
|
|
|
|
HTMLProofer.check_directory("./_site", options).run
|
|
|
|
end
|
|
|
|
|
|
|
|
task :test do
|
|
|
|
run_htmlproofer()
|
|
|
|
end
|
2021-07-16 20:12:08 +08:00
|
|
|
|
|
|
|
task :build do
|
|
|
|
sh "bundle exec jekyll build -d _site/stabilizer"
|
|
|
|
end
|