Repository navigation
[web] Adopt the new logo on cloudprober's built-in web pages - #1474
Merged
Merged
Conversation
The status page, /alerts, /logs, /config-* and the artifacts browser still had no favicon at all and a monospace "Cloudprober" text header, predating the brand kit added in #1468. Copy favicon.ico and the horizontal and icon SVGs from docs/brand into web/static, where the existing //go:embed static/* already picks them up. Add resources.HeadLinks(), which emits the stylesheet plus the favicon links, and wire it into all three page shells (web/resources, probestatus, artifacts) so they no longer each spell out the CSS link. Those shells also gain a <title>, which none of them had. The header becomes the horizontal lockup at 170px, linking to cloudprober.org. The Github link next to it is dropped -- it crowded the wordmark, and the site it points to is one click from the logo. The grey header bar goes too: it existed to make the monospace text read as a title bar, and around a lockup that already carries a cap height of clear space in its own viewBox it was just padding a second time, with the <hr/> below already doing the separating. Finally, replace the fixed <br><br><br><br> under the floated info block with a clear:both div, matching what the artifacts page already did. The hard-coded count silently broke the moment a line was added to the block and let the next heading ride up alongside the links.
Follow-up to the previous commit, from review.
The shared <title> I added was the literal "Cloudprober" on every page,
so two open tabs -- /alerts and /logs, say -- became indistinguishable.
Before that commit there was no <title> at all and browsers fell back to
the URL, which at least told them apart. Add resources.PageTitle(), which
puts the page's own path first ("/alerts - Cloudprober") so the tellable
part survives tab truncation, and use it in all three shells. The status
page path comes from config, so it is escaped.
Add TestBrandAssetsMatchBrandKit, comparing the three assets in
web/static against their docs/brand sources through the embedded
filesystem. They are //go:embed-ed, so a copy someone forgot to refresh
would otherwise ship the old logo in the binary with nothing to catch it
-- the existing tests only assert the files are served and parse as SVG.
Drop probestatus's LinkPrefix template field, dead since the previous
commit replaced its only use, {{.LinkPrefix}}static/cloudprober.css,
with {{.HeadLinks}}.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The status page,
/alerts,/logs,/config-*and the artifacts browser still had no favicon at all and a monospace "Cloudprober" text header, predating the brand kit added in #1468. This brings them onto the new logo.Assets
favicon.icoand the horizontal and icon SVGs are copied fromdocs/brand/intoweb/static/, where the existing//go:embed static/*already picks them up — they're byte-identical to the kit.docs/brand/README.mdgains a section under Publishing a change recording this second set of copies alongside thedocs/static/one, with thecpcommands to refresh them.Shared head and header
New
resources.HeadLinks()emits the stylesheet plus the<link rel="icon">tags (.icoat 32x32 and the SVG icon), following the wiring documented in the brand README. It's wired into all three page shells —web/resources,probestatus, and the artifacts browser — which previously each spelled out the CSS link on their own. Paths stay relative, so this still works when the status page is mounted at a custom URL or served behind a non-root path.Those shells also gain a
<title>, which none of them had; with a favicon in place, tabs were otherwise showing the bare URL.The header itself becomes the horizontal lockup at 170px wide, linking to cloudprober.org:
(Github)link beside it is dropped. It crowded the wordmark, and the site the logo points to links to the repo anyway.<hr/>below already separates the header from the content. Tightening its padding instead only bought ~10px of the ~70px, since the height comes from the lockup and its built-in padding, not the CSS.Drive-by fix
The floated info block was cleared by a fixed
<br><br><br><br>. That count silently broke the moment a line was added to the block — the next heading rode up alongside the links. Replaced with aclear: bothdiv, which is what the artifacts page already did.Verification
gofmtandgo vetclean;go testgreen acrossweb/...,internal/surfacers/probestatus, andprobes/browser/.... Golden HTML inheader_test.goandtemplates_test.goupdated, andweb_test.gogains cases asserting the three new assets serve over/static/. Also ran the binary against a live config and checked/status,/alertsand the assets in a browser.