diff --git a/.github/workflows/README.md b/.github/workflows/README.md index e2745016..1da92512 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -42,6 +42,10 @@ Run a11ywatch GitHub action to check accessibility of the site. This action reminds users to add a meaningful alternative text to their images. +## link-check.yml + +This action checks content links for issues using https://github.com/gjtorikian/html-proofer. + # References * https://github.com/pa11y/pa11y @@ -50,7 +54,6 @@ This action reminds users to add a meaningful alternative text to their images. * https://engineering.18f.gov/accessibility-scanning/ * https://medium.com/@f3igao/how-to-automate-web-accessibility-testing-921512bdd4bf * https://stackoverflow.com/questions/58858429/how-to-run-a-github-actions-step-even-if-the-previous-step-fails-while-still-f -* https://docs.gitlab.com/ee/user/project/merge_requests/accessibility_testing.html * https://stackoverflow.com/questions/57915432/write-output-of-npm-run-start-to-a-file * https://github.com/marketplace/actions/comment-pull-request * https://pre-commit.com/ @@ -58,4 +61,5 @@ This action reminds users to add a meaningful alternative text to their images. * https://stackoverflow.com/questions/62325286/run-github-actions-when-pull-requests-have-a-specific-label * https://github.com/marketplace/actions/push-directory-to-another-repository * https://github.com/marketplace/actions/find-and-replace -* https://github.com/marketplace/actions/publish-unit-test-results +* https://github.com/gjtorikian/html-proofer +* https://danielsieger.com/blog/2021/03/28/check-broken-links-jekyll.html diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 00000000..b33a36f1 --- /dev/null +++ b/.github/workflows/link-check.yml @@ -0,0 +1,28 @@ +name: Checking links + +on: + # Automatic check weekly + schedule: + - cron: "0 9 * * 1" + pull_request: + +jobs: + build: + name: Building site and running HTML proofer + runs-on: ubuntu-latest + + steps: + - name: Checkout source. + uses: actions/checkout@v2 + + - name: Install jekyll site dependencies. + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + bundler-cache: true + + - name: Build site + run: npm run build + + - name: Run HTML proofer. + run: npm run link-checker diff --git a/Gemfile b/Gemfile index e90919d8..e0d1050a 100644 --- a/Gemfile +++ b/Gemfile @@ -7,3 +7,5 @@ group :jekyll_plugins do gem 'jekyll-redirect-from' gem 'jekyll-feed' end + +gem 'html-proofer' diff --git a/Gemfile.lock b/Gemfile.lock index a92cf70c..5d1455f5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,9 +8,20 @@ GEM em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) + ethon (0.16.0) + ffi (>= 1.15.0) eventmachine (1.2.7) ffi (1.15.5) forwardable-extended (2.6.0) + html-proofer (4.4.3) + addressable (~> 2.3) + mercenary (~> 0.3) + nokogiri (~> 1.13) + parallel (~> 1.10) + rainbow (~> 3.0) + typhoeus (~> 1.3) + yell (~> 2.0) + zeitwerk (~> 2.5) http_parser.rb (0.8.0) i18n (1.10.0) concurrent-ruby (~> 1.0) @@ -51,10 +62,17 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.4.0) + mini_portile2 (2.8.5) + nokogiri (1.13.10) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) + parallel (1.24.0) pathutil (0.16.2) forwardable-extended (~> 2.6) posix-spawn (0.3.15) public_suffix (4.0.7) + racc (1.7.3) + rainbow (3.1.1) rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) @@ -65,12 +83,17 @@ GEM ffi (~> 1.9) terminal-table (2.0.0) unicode-display_width (~> 1.1, >= 1.1.1) + typhoeus (1.4.1) + ethon (>= 0.9.0) unicode-display_width (1.8.0) + yell (2.2.2) + zeitwerk (2.6.13) PLATFORMS ruby DEPENDENCIES + html-proofer jekyll-feed jekyll-last-modified-at jekyll-redirect-from diff --git a/_guide/champions-program.md b/_guide/champions-program.md index 9824f448..4bd86676 100644 --- a/_guide/champions-program.md +++ b/_guide/champions-program.md @@ -173,7 +173,6 @@ Many joined CivicActions because they wanted to work for an impact-driven organi * [LinkedIN's Program](https://engineering.linkedin.com/blog/2019/05/scaling-accessibility-through-a11y-champions-program) * Intuit (Quickbooks) * [The A11y Global Collective: Scaling Accessibility — Intuit's Accessibility Champions Program (YouTube)](https://www.youtube.com/watch?v=np6sIWUTPlE) - * [The A11y Global Collective: Scaling Accessibility — Intuit's Accessibility Champions Program Slides (PDF)](http://www.last-child.com/wp-content/uploads/2021/09/Accessibility-Champions.pdf) * [Intuit's Accessibility Champion Program](https://www.last-child.com/intuits-accessibility-champion-program/) * [Lessons Learned from an Intuit Accessibility Champion (Blog)](https://www.intuit.com/blog/innovation/lessons-learned-from-an-intuit-accessibility-champion/) * AbilityNet diff --git a/_guide/tools.md b/_guide/tools.md index 50a9fdc4..072a8f31 100644 --- a/_guide/tools.md +++ b/_guide/tools.md @@ -112,7 +112,7 @@ Evaluate WAI-ARIA according to the [ARIA in HTML](https://www.w3.org/TR/html-ari ### Web based contrast tools * [Contrast Finder by Tanaguru](https://contrast-finder.tanaguru.com/) - [Contrast Finder GitHub Page](https://github.com/Tanaguru/Contrast-Finder) -* [Contrast-Ratio.com](https://contrast-Ratio.com) - [Contrast-Ratio GitHub Page]([https://github.com/LeaVerou/contrast-ratio](https://github.com/siege-media/contrast-ratio)) \ +* [Contrast-Ratio.com](https://contrast-Ratio.com) - [Contrast-Ratio GitHub Page](https://github.com/siege-media/contrast-ratio) \ Allows for testing of contrast of text on top of a semi transparent background. * [Contrast Checker](https://contrast-checker.glitch.me/) - [Contrast Checker on Glitch](https://glitch.com/edit/#!/contrast-checker?path=server.js%3A1%3A0) * [ButtonBuddy](https://buttonbuddy.dev/) - [ButtonBuddy on GitHub](https://github.com/5t3ph/buttonbuddy) diff --git a/package.json b/package.json index bc5a1a03..0cf47d17 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "license": "Creative Commons Attribution-ShareAlike 4.0 International Public License", "scripts": { "postinstall": "bundle", + "build": "bundle exec jekyll build", "start": "bundle exec jekyll serve", "start-detached": "bundle exec jekyll serve --detach", "setup-uswds": "npm run sync-assets && npm run sync-sass", @@ -11,7 +12,8 @@ "sync-sass": "rsync -avr --delete node_modules/uswds/src/stylesheets/ _sass/uswds/src/", "pa11y-ci:home": "pa11y-ci http://127.0.0.1:4000", "pa11y-ci:sitemap": "pa11y-ci --sitemap http://127.0.0.1:4000/sitemap.xml --sitemap-find https://accessibility.civicactions.com --sitemap-replace http://127.0.0.1:4000 --sitemap-exclude \"/*.pdf\"", - "cypress-tests": "cypress run --browser chrome --headless" + "cypress-tests": "cypress run --browser chrome --headless", + "link-checker": "bundle exec htmlproofer --ignore-status-codes \"999,403,302,0\" --ignore-urls \"/fonts.gstatic.com/\" --enforce_https \"false\" ./_site" }, "dependencies": { "simple-jekyll-search": "^1.9.2"