From 8a2490a1d31219dd732cc948d746cb58d8e578f3 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 3 Oct 2018 16:48:38 +0100 Subject: [PATCH] docs: check links with `html-proofer` This can be done with `bundle exec rake test`. --- docs/.ruby-version | 2 +- docs/Gemfile | 5 +++++ docs/Gemfile.lock | 17 ++++++++++++++++- docs/Rakefile | 31 +++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 docs/Rakefile diff --git a/docs/.ruby-version b/docs/.ruby-version index 005119baaa..73462a5a13 100644 --- a/docs/.ruby-version +++ b/docs/.ruby-version @@ -1 +1 @@ -2.4.1 +2.5.1 diff --git a/docs/Gemfile b/docs/Gemfile index 0c8671cdee..ca9b7428d0 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -1,3 +1,8 @@ source "https://rubygems.org" gem "github-pages", group: :jekyll_plugins + +group :test do + gem "html-proofer" + gem "rake" +end diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 666fed1dac..cb64cafea2 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -13,6 +13,7 @@ GEM execjs coffee-script-source (1.11.1) colorator (1.1.0) + colorize (0.8.1) commonmarker (0.17.13) ruby-enum (~> 0.5) concurrent-ruby (1.0.5) @@ -84,6 +85,15 @@ GEM html-pipeline (2.8.4) activesupport (>= 2) nokogiri (>= 1.4) + html-proofer (3.9.2) + activesupport (>= 4.2, < 6.0) + addressable (~> 2.3) + colorize (~> 0.8) + mercenary (~> 0.3.2) + nokogiri (~> 1.8.1) + parallel (~> 1.3) + typhoeus (~> 1.3) + yell (~> 2.0) http_parser.rb (0.6.0) i18n (0.9.5) concurrent-ruby (~> 1.0) @@ -209,9 +219,11 @@ GEM mini_portile2 (~> 2.3.0) octokit (4.12.0) sawyer (~> 0.8.0, >= 0.5.3) + parallel (1.12.1) pathutil (0.16.1) forwardable-extended (~> 2.6) public_suffix (2.0.5) + rake (12.3.1) rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) @@ -237,12 +249,15 @@ GEM tzinfo (1.2.5) thread_safe (~> 0.1) unicode-display_width (1.4.0) + yell (2.0.7) PLATFORMS ruby DEPENDENCIES github-pages + html-proofer + rake BUNDLED WITH - 1.16.1 + 1.16.4 diff --git a/docs/Rakefile b/docs/Rakefile new file mode 100644 index 0000000000..e968de9dee --- /dev/null +++ b/docs/Rakefile @@ -0,0 +1,31 @@ +require "rake" + +task default: :build + +desc "Build the site." +task :build do + sh "jekyll", "build" +end + +desc "Run html proofer to validate the HTML output." +task test: :build do + require "html-proofer" + HTMLProofer.check_directory( + "./_site", + parallel: { in_threads: 4 }, + favicon: true, + http_status_ignore: [0, 403], + assume_extension: true, + check_favicon: true, + check_opengraph: true, + check_html: true, + check_img_http: true, + file_ignore: [ + %r{Kickstarter-Supporters}, + ], + url_ignore: [ + "http://formulae.brew.sh", + %r{https://github.com/Homebrew/brew/edit/gh-pages//}, + ] + ).run +end