350dcb0b
chrome: a default favicon, optional listing columns, and a table partial
Three services asked for a favicon field and bench argued against one: it ships no icon deliberately, and its layout says why — a <link rel="icon"> pointing at an asset the binary does not have is a 404 on every page load, for a file nobody asked for. A default that is a path hands that to every service without a logo, so the default carries its own bytes instead: the brand's ring as a data: URI, which cannot 404 and costs no request. It is a template.URL because html/template rewrites any href whose scheme is not http, https or mailto to "#ZgotmplZ" — the type is how a caller says it meant a data: URI. Updated and Meta are optional for the reason the four listing services could not agree: bench and spec have a modification time, dolt's schema has no timestamp at all, and cover's index is a table of sparklines no shared partial will render. A required column would have pushed dolt back onto a local copy. Updated is a time.Time so the partial renders "3 hours ago" with the exact stamp in the title once, rather than five services spelling it five ways. srht-repo-table is a second partial over the same dot rather than a variadic first one: growing columns on the cards would have made them worse cards for the services that wanted cards. Attach now installs Funcs itself, because the partials call reltime and abstime and an unknown function is a parse error — a caller who had not merged Funcs would have got a startup panic naming a template it never wrote. pages consequently attaches before layering the service's own map on top, which is what keeps a deliberate shadow working.
Eugene Blikh <bigbes@gmail.com> — 2026-08-08 20:59:37 UTC
Commit 350dcb0b3f5b23b25ba8603c430361b0e798f07c —
view raw patch
Parent(s):
f019dbe4
| File | Status | + | − |
|---|---|---|---|
chrome/chrome.go
|
M | +65 | -3 |
chrome/chrome_test.go
|
M | +87 | |
chrome/templates.go
|
M | +11 | -4 |
chrome/templates/chrome.tmpl
|
M | +52 | |
pages/pages.go
|
M | +5 | -1 |