sitelinks

command
v0.85.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command sitelinks says whether every local link of a BUILT static site leads to a file of that build:

sitelinks [--base /docs/development/] PUBLIC_DIR

It reads every .html under PUBLIC_DIR, takes the href, src, poster and srcset attributes, resolves each local one against the page's own URL under --base, and checks that the target exists in the build (a directory counts when it holds an index.html). External links are not fetched.

⛔ It parses HTML, it does not grep it. The first version was a regular expression over the page and reported two "broken" links on every page of a Hugo site: `e.docsRoot+t.version+` and a minified line of a version-selector script, both read as an href= inside an inline <script>. Attributes come from golang.org/x/net/html's tokenizer here, so text inside <script> is never an attribute.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL