Files
probot.github.io/script/html-proofer
2018-04-14 10:21:32 -05:00

33 lines
841 B
Ruby
Executable File

#!/usr/bin/env ruby
require "bundler/setup"
require "html-proofer"
# add links to ignore here
url_ignores = [
# Installation links require being signed in to GitHub
%r{https://github.com/apps/.*/installations/new},
"https://mochajs.org/",
%r{mit-license\.org}, # misconfigured SSL or old certs on Travis CI?
%r{https://localhost:*/*}, # Ignore links to localhost in documentation
]
begin
HTMLProofer::Runner.new(["_site"],
:type => :directory,
:url_ignore => url_ignores,
:file_ignore => [%r{_site/api/}],
:verbose => !!ENV["VERBOSE"],
:check_html => true,
:empty_alt_ignore => true,
:typhoeus => {
# Work around SSL errors: https://github.com/gjtorikian/html-proofer/issues/376
:ssl_verifypeer => false,
:ssl_verifyhost => 0
}
).run
rescue => e
puts "\n", e
exit 1
end