1.1.16 • Published 6 years ago

makestatic-verify-link v1.1.16

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Verify Link

Verify externals links return valid HTTP status codes

For each HTML file check that a elements with an href pointing to an absolute external URL returns a valid HTTP status code.



Install

yarn add makestatic-verify-link

API

VerifyLink

Verify external absolute links return valid HTTP status codes.

A valid status code is 200, 301 or 302. In the case of the redirect status codes the target server must send a Location header otherwise an error is thrown. Redirects are followed until maxRedirects is reached.

See Also

VerifyLink

new VerifyLink(context, options)

Create a VerifyLink plugin.

Configure this plugin for the verify phase. Requires that the http-cache and graph-resources plugins have been configured.

  • context Object the processing context.
  • options Object the plugin options.
Options
  • strict Boolean=true warn rather than error when false.
  • maxRedirects Number=2 maximum number of redirects to follow.
Throws
  • Error if no HTTP agent is configured.
  • Error if no resource graph is available.

.after

VerifyLink.prototype.after(context, options)

Verifies that external absolute links (those with a protocol) return a 200 or 3xx HTTP status code.

When strict is disabled an error is not thrown but a warning message is logged.

  • context Object the processing context.
  • options Object the plugin options.
Throws
  • Error when a link returns an invalid status code in strict mode.

License

MIT


Created by mkdoc on March 12, 2017

1.1.16

6 years ago

1.1.15

6 years ago

1.1.14

7 years ago

1.1.13

7 years ago

1.1.12

7 years ago

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago