Documentation
¶
Overview ¶
Package main implements editurl: whether a Hextra site's "Edit this page on GitHub" link points at the page's own source.
editurl asks whether a Hextra site's "Edit this page on GitHub" link reaches the page's own source.
editurl # every checkout under the clone root editurl --repo go-desktop/docs # one of them editurl --fail-on-broken # exit 1 if any site's links do not resolve
⛔ WHY IT READS THE REPOSITORY AND NOT THE URL -- which is the opposite of pagescheck, deliberately. GitHub's /edit/ route AUTHENTICATES BEFORE IT RESOLVES THE PATH, so an anonymous request to an existing repository answers 302 to the login page whatever the path is. Measured 2026-11-15:
github.com/go-desktop/docs/edit/main/content/en/finding.md 302 (correct) github.com/go-desktop/docs/edit/main/content/en/en/finding.md 302 (no such file) github.com/go-desktop/edit/main/content/en/finding.md 404 (no such repository)
A fetcher can only see the third. It would have scored eleven of the seventy-seven broken sites as healthy, and it would need a token to see even that much. The repository knows: the href names a path, and either that path is in the tree or it is not.
⛔ WHAT THE DEFECT LOOKS LIKE, and why nothing saw it for months (go-fleettools/fleettools#287, 77 of 100 docs sites). Hextra appends the page's path relative to content/ -- which on a multilingual site already starts with en/ -- so a base ending at content/en renders …/content/en/en/page.md. On top of that, 66 of those bases drop the repository segment and name github.com/<org>/edit/main/…, a repository called "edit" that does not exist. Both live in a .yaml, and the checks that read published pages walked .md, .html and .toml and never opened one (go-desktop/catalog#28 added .yaml to that walk, and go-desktop's own broken link surfaced on the first run).
⛔ A SIGNED-IN READER DOES NOT GET A 404 FOR THE DOUBLED FORM, which is worse than one. GitHub offers them its "create a new file" editor at a path the site never serves, so a correction typed there lands in a file nothing builds. Measured through the contents API, which is the oracle this tool uses locally:
repos/go-fleettools/docs/contents/content/en/en/repos/fleettools.md 404 repos/go-fleettools/docs/contents/content/en/repos/fleettools.md 200