Development record
The site renderer links a repository file on the forge through a hard-coded blob/main path (internal/core/site/compose.go siteHref and seven sibling sites in compose.go, csl.go, explorer.go and graphpage.go), so a managed repository whose default branch is not main serves forge links that 404; the build reads no forge, and blob/HEAD names the default branch whatever it is
issueresolvedminoriss-2609261206437257
The site renderer links a repository file on the forge through a hard-coded blob/main path (internal/core/site/compose.go siteHref and seven sibling sites in compose.go, csl.go, explorer.go and graphpage.go), so a managed repository whose default branch is not main serves forge links that 404; the build reads no forge, and blob/HEAD names the default branch whatever it is
Grounds
- pursued: a managed repository whose default branch is not main gets forge links that resolve; a rendered page still carrying blob/main would show it wrong
Frontmatter
| id | iss-2609261206437257 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | minor |
.abcd/work/issues/resolved/iss-2609261206437257-the-site-renderer-links-a-repository.md
open on GitHub ↗ · commit history ↗
mentions1
- iss-2609261241126008The site's commit-history links still name the main branch: internal/core/site/explorer.go and graphpage.go build commits/main/ forge links, which 404 on a repository whose default branch is not main, while iss-2609261206437257's resolution says every forge file link names blob/HEAD. The history links should go through the same helper family and name commits/HEAD/, which the forge resolves to the default branch. Found while fixing it: the record page's link for a relative non-markdown target (explorer.go, the directory or file beside a record) builds <repository>/tree/main/ or /blob/main/ the same way, so it goes through the helper too.