1.1.16 • Published 7 years ago

makestatic-verify-link v1.1.16

Weekly downloads
3
License
MIT
Repository
github
Last release
7 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

7 years ago

1.1.15

7 years ago

1.1.14

8 years ago

1.1.13

8 years ago

1.1.12

8 years ago

1.1.11

8 years ago

1.1.10

8 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago