visuals: technology marks, area icons, client wall, two diagrams
Phase 7 (AUD-149), cheapest first. - internal/brand: vendored Simple Icons path data (CC0) for 50 marks, looked up by the technology label the content already uses. Inline SVG, 16 px, currentColor, no request and no font. tools/gen_brand_icons.sh regenerates it. - Six hand-drawn area icons replace the two-letter badges in the nav and on the landing cards; the evidence index gets a seventh. - TechChips renders a mark where one exists and plain text where one does not, so a missing icon reads as a decision rather than a broken image. - Client wall: 45 names as one typeface, one size, one grid of equal tiles, and the reason for no logo collage written on the page. No mark invented. - Two diagrams, authored in-repo: homelab topology (platform-network.md) and the RAG pipeline (ai-rag-corpus.md), each referenced from the page it explains. - Content images now carry intrinsic width/height, loading="lazy" and decoding="async" at render time; a site test fails the build if an image ships without them. - Topbar is two rows at desktop: the area names plus marks no longer overlap the search form (Lighthouse target-size was failing at 1440 px). - Favicon, so the browser stops requesting a missing /favicon.ico. Satisfies: logos on every area page, area icons in nav and cards, two diagrams referenced from their pages, images sized and lazy, Lighthouse >= 95 held. (cherry picked from commit a473e4738a3751418c2097df2bcf0568fb6d0208)
This commit is contained in:
@@ -263,3 +263,35 @@ func TestSearchIndexFollowsContent(t *testing.T) {
|
||||
t.Errorf("token found at %s, want /edge/edge-fleet/", results[0].URL)
|
||||
}
|
||||
}
|
||||
|
||||
// TestImagesReserveTheirSpace is the layout-shift guard: every image a content
|
||||
// page carries must declare its intrinsic size and load lazily, so a page of
|
||||
// diagrams and screenshots never reflows as the files arrive.
|
||||
func TestImagesReserveTheirSpace(t *testing.T) {
|
||||
s := newSite(t)
|
||||
seen := 0
|
||||
for _, d := range s.Content.Docs {
|
||||
html := d.HTML
|
||||
for i := 0; ; i++ {
|
||||
start := strings.Index(html, "<img ")
|
||||
if start < 0 {
|
||||
break
|
||||
}
|
||||
end := strings.Index(html[start:], ">")
|
||||
if end < 0 {
|
||||
break
|
||||
}
|
||||
tag := html[start : start+end+1]
|
||||
html = html[start+end+1:]
|
||||
seen++
|
||||
for _, want := range []string{`width="`, `height="`, `loading="lazy"`, `alt="`} {
|
||||
if !strings.Contains(tag, want) {
|
||||
t.Errorf("%s: image tag missing %s: %s", d.Path, want, tag)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if seen == 0 {
|
||||
t.Fatal("no images found in content; the guard is not exercising anything")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user