Skip to content

Commit 96a6a2d

Browse files
committed
Add html-proofer as a validation mechanism
1 parent d367a86 commit 96a6a2d

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

.github/workflows/validate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ jobs:
2525
bundler-cache: true
2626
cache-version: 1
2727

28-
- name: Build
29-
run: rake build
28+
- name: Build & Validate
29+
run: rake validate

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ gem 'kramdown-parser-gfm'
99
gem 'jekyll', 3.9
1010
gem 'jekyll-redirect-from'
1111

12+
# For testing output
13+
gem 'html-proofer'
14+
1215
# Avoid polling on windows
1316
gem 'wdm', '>= 0.1.0'

Gemfile.lock

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,21 @@ GEM
88
em-websocket (0.5.2)
99
eventmachine (>= 0.12.9)
1010
http_parser.rb (~> 0.6.0)
11+
ethon (0.15.0)
12+
ffi (>= 1.15.0)
1113
eventmachine (1.2.7)
1214
eventmachine (1.2.7-x64-mingw32)
1315
ffi (1.15.0)
1416
ffi (1.15.0-x64-mingw32)
1517
forwardable-extended (2.6.0)
18+
html-proofer (3.19.2)
19+
addressable (~> 2.3)
20+
mercenary (~> 0.3)
21+
nokogumbo (~> 2.0)
22+
parallel (~> 1.3)
23+
rainbow (~> 3.0)
24+
typhoeus (~> 1.3)
25+
yell (~> 2.0)
1626
http_parser.rb (0.6.0)
1727
i18n (0.9.5)
1828
concurrent-ruby (~> 1.0)
@@ -44,12 +54,23 @@ GEM
4454
rb-fsevent (~> 0.10, >= 0.10.3)
4555
rb-inotify (~> 0.9, >= 0.9.10)
4656
mercenary (0.3.6)
57+
mini_portile2 (2.6.1)
4758
neat (3.0.0)
4859
sass (~> 3.4)
4960
thor (~> 0.19)
61+
nokogiri (1.12.5)
62+
mini_portile2 (~> 2.6.1)
63+
racc (~> 1.4)
64+
nokogiri (1.12.5-x64-mingw32)
65+
racc (~> 1.4)
66+
nokogumbo (2.0.5)
67+
nokogiri (~> 1.8, >= 1.8.4)
68+
parallel (1.21.0)
5069
pathutil (0.16.2)
5170
forwardable-extended (~> 2.6)
5271
public_suffix (4.0.6)
72+
racc (1.5.2)
73+
rainbow (3.0.0)
5374
rake (12.3.3)
5475
rb-fsevent (0.10.4)
5576
rb-inotify (0.10.1)
@@ -63,13 +84,17 @@ GEM
6384
rb-fsevent (~> 0.9, >= 0.9.4)
6485
rb-inotify (~> 0.9, >= 0.9.7)
6586
thor (0.20.3)
87+
typhoeus (1.4.0)
88+
ethon (>= 0.9.0)
6689
wdm (0.1.1)
90+
yell (2.2.2)
6791

6892
PLATFORMS
6993
ruby
7094
x64-mingw32
7195

7296
DEPENDENCIES
97+
html-proofer
7398
jekyll (= 3.9)
7499
jekyll-redirect-from
75100
kramdown

Rakefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,15 @@ end
2323
task :build => [:dependencies, :submodules] do
2424
sh('bundle exec jekyll build --config _config.yml')
2525
end
26+
27+
task :validate => [:build] do
28+
# Explanation of arguments:
29+
# --assume-extension # Tells html-proofer that `.html` files can be accessed without the `.html` part in the url.
30+
# --disable-external # For speed. Ideally we'd check external links too, but ignoring for now.
31+
# --empty-alt-ignore # To avoid needing to fix lots upfront, we can migrate towards this later.
32+
# --allow-hash-href # Allow empty `#` links to mean "top of page". It's true that these can be errors, however we have far too many to really address this.
33+
# --url-swap # Adjust for Jekyll's baseurl. See https://github.com/gjtorikian/html-proofer/issues/618 for more.
34+
# --url-ignore # Allow mailto links without a target email, for our Share links. Works around https://github.com/gjtorikian/html-proofer/issues/552.
35+
# # Allow old event links which aren't easily updated.
36+
sh('bundle exec htmlproofer _site --assume-extension --disable-external --empty-alt-ignore --allow-hash-href --url-swap "^/docs/:/"')
37+
end

0 commit comments

Comments
 (0)