https://github.com/nickcolley/eleventy-plugin-accessibility
An Eleventy plugin to check for accessibility issues in HTML using axe.
https://github.com/nickcolley/eleventy-plugin-accessibility
Last synced: 5 months ago
JSON representation
An Eleventy plugin to check for accessibility issues in HTML using axe.
- Host: GitHub
- URL: https://github.com/nickcolley/eleventy-plugin-accessibility
- Owner: NickColley
- License: mit
- Created: 2019-10-18T21:33:59.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2020-10-28T23:52:45.000Z (over 5 years ago)
- Last Synced: 2025-04-08T08:52:28.390Z (about 1 year ago)
- Language: JavaScript
- Size: 93.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eleventy-plugin-accessibility
An [Eleventy](https://github.com/11ty/eleventy) plugin to check for accessibility issues in HTML using axe.

## Installation
This is an alpha package so it is not on npm yet, but you can try it out by installing it directly from GitHub.
```
npm install --save-dev nickcolley/eleventy-plugin-accessibility
```
Open up your Eleventy config file (probably `.eleventy.js`) and use `addPlugin`.
Only run the plugin in a test environment to avoid slow builds.
```
const accessibilityPlugin = require("eleventy-plugin-accessibility");
module.exports = function(eleventyConfig) {
if (process.env.NODE_ENV === "test") {
eleventyConfig.addPlugin(accessibilityPlugin);
}
};
```
In your `package.json` update your tests scripts:
```json
{
"scripts": {
"test": "NODE_ENV=test eleventy 2>&1 | tee -a /tmp/ci-output.txt; if grep -Fq 'Linter' /tmp/ci-output.txt; then exit 1; fi"
}
}
```
At the moment [Eleventy linters do not fail the build](https://github.com/11ty/eleventy/issues/673) which is why this is needed.
## Running it
To only run this in
Read more about [Eleventy plugins.](https://www.11ty.io/docs/plugins/)