Add initial a11y config for docs site (#1067)

This commit is contained in:
Jonathan Wren 2020-10-31 13:59:38 -07:00 committed by GitHub
parent b0b98d85fe
commit 57de3b7d81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 311 additions and 236 deletions

19
.circleci/pa11y.sh Executable file
View file

@ -0,0 +1,19 @@
#! /bin/bash
set +e
reports_dir="reports/pa11y"
site_url="http://127.0.0.1:8000"
exit_code=0
mkdocs build
mkdir -p "$reports_dir"
printf -- 'scanning: /\n'
./node_modules/.bin/pa11y "$site_url" --reporter junit > "$reports_dir/root.xml" || exit_code=2
for file in $(xq '.urlset.url[].loc' site/sitemap.xml -r | sed -r 's!https://jrnl.sh/(.*?)/$!\1!'); do
printf -- 'scanning: /%s\n' "$file"
./node_modules/.bin/pa11y "$site_url/$file" --reporter junit > "$reports_dir/$file.xml" || exit_code=2
done
exit $exit_code