Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update installation instructions #13

Merged
merged 1 commit into from
Apr 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,57 @@ need more granular control or want to add a different [TAP-reporter](https://www

## Installation

```
npm install --save-dev netlify-plugin-checklinks
```
To install, add the following lines to your `netlify.toml` file:

Then add the following to your `netlify.yml`:

```yml
plugins:
- type: netlify-plugin-checklinks
```toml
[[plugins]]
package = "netlify-plugin-checklinks"
```

Note: The `[[plugins]]` line is required for each plugin, even if you have other plugins in your `netlify.toml` file already.

## Configuration

Checklinks works out of the box, but can be improved upon with some improved knowledge about your site.

These are the configuration options with their default values:

```yml
plugins:
- type: netlify-plugin-checklinks
config:
# An array of glob patterns for pages on your site
# Recursive traversal will start from these
entryPoints:
- '*.html'

# Recurse through all the links and asset references on your page, starting
# at the entrypoints
recursive: true

# Checklinks outputs TAP (https://testanything.org/tap-version-13-specification.html)
# by default. Enabling pretty mode makes the output easier on the eyes.
pretty: true

# You can mark some check as skipped, which will block checklinks
# from ever attempting to execute them.
# skipPatterns is an array of strings you can match against failing reports
skipPatterns: []

# You can mark some check as todo, which will execute the check, but allow failures.
# todoPatterns is an array of strings you can match against failing reports
todoPatterns: []

# Report on all broken links to extrnal pages.
# Enabling this will make your tests more brittle, since you can't control
# external pages.
checkExternal: false

# Enable to check references to source maps, source map sources etc.
# Many build tools don't emit working references, so this is disabled by default
followSourceMaps: false
```toml
[[plugins]]
package = "netlify-plugin-checklinks"

[plugins.inputs]
# An array of glob patterns for pages on your site
# Recursive traversal will start from these
entryPoints = [
"*.html",
]

# Recurse through all the links and asset references on your page, starting
# at the entrypoints
recursive = true

# Checklinks outputs TAP (https://testanything.org/tap-version-13-specification.html)
# by default. Enabling pretty mode makes the output easier on the eyes.
pretty = true

# You can mark some check as skipped, which will block checklinks
# from ever attempting to execute them.
# skipPatterns is an array of strings you can match against failing reports
skipPatterns = []

# You can mark some check as todo, which will execute the check, but allow failures.
# todoPatterns is an array of strings you can match against failing reports
todoPatterns = []

# Report on all broken links to extrnal pages.
# Enabling this will make your tests more brittle, since you can't control
# external pages.
checkExternal = false

# Enable to check references to source maps, source map sources etc.
# Many build tools don't emit working references, so this is disabled by default
followSourceMaps = false
```

## License
Expand Down