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.