Home

Awesome

hyperlink

A command-line tool to find broken links in your static site.

Installation and Usage

Download the latest binary and:

# Check a folder of HTML
./hyperlink public/

# Also validate anchors
./hyperlink public/ --check-anchors

# src/ is a folder of Markdown. Show original Markdown file paths in errors
./hyperlink public/ --sources src/

GitHub action

- uses: untitaker/hyperlink@0.1.32
  with:
    args: public/ --sources src/

NPM

npm install -g @untitaker/hyperlink
hyperlink public/ --sources src/

Docker

docker run -v $PWD:/check ghcr.io/untitaker/hyperlink:0.1.32 /check/public/ --sources /check/src/

# specific commit
docker run -v $PWD:/check ghcr.io/untitaker/hyperlink:sha-82ca78c /check/public/ --sources /check/src

See all available tags

From source

cargo install --locked hyperlink  # latest stable release
cargo install --locked --git https://github.com/untitaker/hyperlink  # latest git SHA

Options

When invoked without options, hyperlink only checks for 404s of internal links. However, it can do more.

Exit codes

Alternatives

(roughly ranked by performance, determined by some unserious benchmark. this section contains partially dated measurements and is not continuously updated with regards to either performance or featureset)

None of the listed alternatives have an equivalent to hyperlink's --sources and --github-actions feature.

Testimonials

We use Hyperlink to check for dead links on Graphviz's static-site user documentation, because:

In conclusion, Hyperlink fills the "static site continuous testing" niche really nicely.

-- Mark Hansen, Graphviz documentation maintainer

License

Licensed under the MIT, see ./LICENSE.