editurl

command
v0.172.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: BSD-3-Clause Imports: 15 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

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

Jump to

Keyboard shortcuts

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