You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-41Lines changed: 22 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,56 +6,47 @@ Run your critical pages through [pa11y](https://github.com/pa11y/pa11y) and fail
6
6
7
7
## Demo
8
8
9
-
https://netlify-plugin-a11y.netlify.com/
9
+
The demo site is a Gatsby blog that has been modified to have some inaccessible elements: https://netlify-plugin-a11y.netlify.com/
10
10
11
-
## Overview
11
+
- the [Hello World](https://netlify-plugin-a11y.netlify.com/hello-world/) page has an image with no `alt` text
12
+
- the [Second Post](https://netlify-plugin-a11y.netlify.com/my-second-post/) page has a form no submit button, and an input with no label.
12
13
13
-
Run axe-cli and fail build if accessibility failures are found.
14
+
You can see the impact of the plugin in the deploy logs of this demo site: https://app.netlify.com/sites/netlify-plugin-a11y/deploys. By default, the plugin is set to error on failure.
14
15
15
-
## Demonstration
16
16
17
-
See this plugin being used in this simplified demo site:
18
-
19
-
You can switch to `resultMode = "warn"` so that builds don't fail:
17
+
But if that is too drastic, you can switch to `resultMode = "warn"` so that builds don't fail:
To install, add the following lines to your `netlify.toml` file:
24
+
25
+
```toml
26
+
[[plugins]]
27
+
package = "netlify-plugin-a11y"
26
28
27
-
- npm and node
28
-
-@Netlify/build (later this will be included in the Netlify CLI)
29
-
- A free [Netlify account](https://netlify.com)
30
-
- Opt-in to Netlify Build Plugin feature support (Not yet publicly available, sorry)
29
+
# all inputs are optional, we just show you the defaults below
30
+
[plugins.inputs]
31
+
32
+
# required config
33
+
checkPaths = ['/'] # you can give an array of directories or paths to html files, that you want to run a11y checks on
34
+
35
+
# # optional config
36
+
# resultMode = "warn" # is "error" by default
31
37
38
+
# # Developer only
39
+
# debugMode = true # extra logging for plugin developers
40
+
```
32
41
33
42
### Including this plugin in a project
34
43
35
44
This plugin can be included via npm. Install it as a dependency for your project like so:
36
45
37
46
```
38
-
npm install --save netlify-plugin-axe
47
+
npm install --save netlify-plugin-a11y
39
48
```
40
49
41
-
### Configuration
42
-
43
-
This plugin will fetch the specified feeds and stash their data prior to the execution of the `build` command you have specified in your Netlify configuration. The desired feeds can be specified in the `netlify.toml` config file. For simpler configuration syntax, I recommend using yaml rather than toml by instead including a `netlify.yml` file.
44
-
45
-
To use plugins, a `plugins` array should be specified in your `netlify.yml`. Each plugin can then be specified with its parameters like so:
46
-
47
-
```yaml
48
-
plugins:
49
-
- netlify-plugin-axe:
50
-
# type: ./path-to-plugin-file | npm-module-name
51
-
type: netlify-plugin-fetch-feeds
52
-
config:
53
-
site: mycoolsite.netlify.com # your Netlify site url
0 commit comments