In the code
The endpoint, in api/TheYard.Api/Program.cs, and the catalog beside the
documents in api/TheYard.Api/Shared/Documentation/DocumentationCatalog.cs:
app.MapGet("/api/docs/diagrams/{name}", Diagram)
.WithName("GetDiagram")
.WithTags("Documents")
.WithSummary("One diagram on its own page")
.WithDescription("The SVG inlined in a small HTML document, so it zooms with the browser and keeps its text selectable.")
.Produces<string>(StatusCodes.Status200OK, "text/html")
.ProducesProblem(StatusCodes.Status404NotFound);
Live from api/TheYard.Api/Features/Docs/DocumentationEndpoints.cs, region diagram-page, read from this build at 99df7a8.
public static readonly IReadOnlyDictionary<string, (string File, string Title)> Diagrams = new Dictionary<string, (string File, string Title)>(StringComparer.Ordinal)
{
["infrastructure"] = ("docs/images/infrastructure.svg", "TheYard infrastructure"),
["dataflow"] = ("docs/images/dataflow.svg", "TheYard data flow"),
["erd"] = ("docs/images/erd.svg", "TheYard's database"),
["two-sites"] = ("docs/images/two-sites.svg", "TheYard's two sites"),
["server-page"] = ("docs/images/server-page.svg", "A page drawn on the server"),
["compiled-ahead"] = ("docs/images/compiled-ahead.svg", "Compiled before it ships"),
["sql-vs-cosmos"] = ("docs/images/sql-vs-cosmos.svg", "SQL Server and Cosmos DB, side by side"),
["ui-architecture"] = ("docs/images/ui-architecture.svg", "TheYard's UI, layer by layer"),
["rings"] = ("docs/images/rings.svg", "TheYard's rings"),
["onion-side-by-side"] = ("docs/images/onion-side-by-side.svg", "The textbook onion, and TheYard's"),
["bid-walk"] = ("docs/images/bid-walk.svg", "One bid through the rings"),
["port-adapter"] = ("docs/images/port-adapter.svg", "The inner ring owns the interface"),
["solid"] = ("docs/images/solid.svg", "SOLID, in plain words"),
["plan-minute"] = ("docs/images/plan-minute.svg", "The plan's minute, from Azure to the card"),
["cloud-infrastructure"] = ("docs/images/cloud-infrastructure.svg", "Cloud infrastructure: eleven cards, seven containers, one frame"),
["deploy-shape"] = ("docs/images/deploy-shape.svg", "One shape for every app that runs"),
["request-path"] = ("docs/images/request-path.svg", "How a request gets answered"),
["vertical-slices"] = ("docs/images/vertical-slices.svg", "The onion cut into vertical slices"),
["traffic-cop"] = ("docs/images/traffic-cop.svg", "One traffic cop for main"),
["archive-job"] = ("docs/images/archive-job.svg", "Old folders are zipped, not kept"),
};
Live from api/TheYard.Api/Shared/Documentation/DocumentationCatalog.cs, region diagrams, read from this build at 99df7a8.
The page itself, api/TheYard.Api/Features/Docs/DiagramPage.cs. The palette is repeated
here and in each SVG on purpose: the page carries no bundle, so the tokens
file is not loaded, and a palette change touches the drawings anyway (ADR:
The palette):
public static string Render(string title, string svg, string sourcePath, string face = "", string address = "")
{
int start = svg.IndexOf("<svg", StringComparison.OrdinalIgnoreCase);
string inline = start > 0 ? svg[start..] : svg;
string safeTitle = WebUtility.HtmlEncode(title);
string description = WebUtility.HtmlEncode(Description(title));
string canonical = address.Length > 0
? $"<link rel=\"canonical\" href=\"{WebUtility.HtmlEncode(address)}\">\n{FeedLink.Html(new Uri(address).GetLeftPart(UriPartial.Authority))}"
: "";
return $$"""
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{safeTitle}}</title>
<meta name="description" content="{{description}}">
{{canonical}}
<link rel="icon" href="{{ApiDocument.Favicon}}">
{{face}}
<style>
html { background: #f3f7f6; }
html, body { margin: 0; color: #5e5653; font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, Arial, sans-serif; font-variant-numeric: tabular-nums; }
body { min-height: 100vh; background: linear-gradient(90deg, #deeaed 0%, #f3f7f6 45%, #ffffff 100%) fixed; }
header { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; padding: 12px 16px 8px; }
h1 { margin: 0; font-size: 16px; color: #3f3a37; }
header p { margin: 0; font-size: 13px; color: #5f636c; }
a { color: #12677f; }
main { padding: 0 16px 16px; }
.op-glass { position: relative; max-width: 1600px; margin: 0 auto; padding: 8px; background: rgba(255, 255, 255, 0.42); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); border: 1px solid rgba(16, 73, 90, 0.18); border-top: 3px solid #10495a; border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 73, 90, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.op-glass::before, .op-glass::after { content: ''; position: absolute; width: 18px; height: 18px; border-color: #10495a; border-style: solid; pointer-events: none; }
.op-glass::before { left: -1px; top: -3px; border-width: 3px 0 0 2px; border-top-left-radius: 10px; }
.op-glass::after { right: -1px; bottom: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: 10px; }
main svg { display: block; width: 100%; height: auto; }
</style>
</head>
<body>
<header>
<h1>{{safeTitle}}</h1>
<p>Pinch or Ctrl+scroll to zoom; the text is selectable. <a href="https:
</header>
<main>
<figure class="op-glass">
{{inline}}
</figure>
</main>
</body>
</html>
""";
}
Live from api/TheYard.Api/Features/Docs/DiagramPage.cs, region page, read from this build at 99df7a8.
The hook that makes links leave the dialog without leaving the app, in
src/lib/markdown.ts since 1.0.0.141, when the renderer moved into a chunk
of its own (ADR: Code that reads like code, addendum):
const SITE = 'https://theyard.stevenstout.biz/';
marked.use({
hooks: {
postprocess(html: string) {
return html
.replaceAll(`href="${SITE}`, 'href="/')
.replace(/<a href="(?!#)/g, '<a target="_blank" rel="noopener" href="');
},
},
});
Live from src/lib/markdown.ts, region doc-links, read from this build at 99df7a8.
The tests, in api/TheYard.Tests/DiagramPageTests.cs: every name in the
catalog opens as HTML with its SVG and its title, an unknown name is a 404,
and the XML prolog a standalone SVG may carry never reaches the page:
[Fact]
public async Task Every_diagram_in_the_catalog_opens_as_a_page_with_its_svg_inlined()
{
Assert.NotEmpty(DocumentationCatalog.Diagrams);
foreach (var (name, diagram) in DocumentationCatalog.Diagrams)
{
var response = await _client.GetAsync($"/api/docs/diagrams/{name}");
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Assert.Equal("text/html", response.Content.Headers.ContentType?.MediaType);
string body = await response.Content.ReadAsStringAsync();
Assert.Contains($"<title>{WebUtility.HtmlEncode(diagram.Title)}</title>", body);
Assert.Contains("name=\"viewport\"", body);
Assert.Contains($"<meta name=\"description\" content=\"{WebUtility.HtmlEncode(DiagramPage.Description(diagram.Title))}\">", body);
Assert.InRange(DiagramPage.Description(diagram.Title).Length, 40, 159);
Assert.Contains($"<link rel=\"canonical\" href=\"https://theyard.stevenstout.biz/api/docs/diagrams/{name}\">", body);
Assert.Contains("<svg", body);
Assert.Contains("</svg>", body);
Assert.DoesNotContain("<?xml", body);
}
}
[Theory]
[InlineData("/api/docs/diagrams/nope")]
[InlineData("/api/docs/diagrams/infrastructure.svg")]
[InlineData("/api/docs/diagrams")]
public async Task An_unknown_diagram_is_a_404_not_a_file_read(string path)
{
var response = await _client.GetAsync(path);
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);
}
[Fact]
public void The_page_drops_an_xml_prolog_and_keeps_the_svg()
{
string page = DiagramPage.Render("A & B", "<?xml version=\"1.0\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\"><title>t</title></svg>", "docs/images/x.svg");
Assert.Contains("<title>A & B</title>", page);
Assert.DoesNotContain("<?xml", page);
Assert.Contains("<svg xmlns=\"http://www.w3.org/2000/svg\"><title>t</title></svg>", page);
Assert.Contains("blob/main/docs/images/x.svg", page);
Assert.Contains($"<link rel=\"icon\" href=\"{ApiDocument.Favicon}\">", page);
}
[Fact]
public void An_apostrophe_in_a_title_reaches_the_tab_encoded()
{
string page = DiagramPage.Render("TheYard's database", "<svg></svg>", "docs/images/erd.svg");
Assert.Contains("<title>TheYard's database</title>", page);
Assert.DoesNotContain("<title>TheYard's database</title>", page);
}
[Fact]
public async Task The_about_page_is_served_with_its_own_head_and_a_person_that_says_no_more_than_it_should()
{
var response = await _client.GetAsync("/about");
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Assert.Equal("text/html", response.Content.Headers.ContentType?.MediaType);
string body = await response.Content.ReadAsStringAsync();
Assert.Contains($"<title>{WebUtility.HtmlEncode(AboutPage.Title)}</title>", body);
Assert.Contains("<h1>Steven Stout</h1>", body);
Assert.Contains("name=\"viewport\"", body);
Assert.Matches("<link rel=\"canonical\" href=\"https?://[^\"]+/about\">", body);
foreach (string property in new[] { "og:url", "og:title", "og:description", "og:image" })
{
Assert.Contains($"property=\"{property}\"", body);
}
Assert.InRange(AboutPage.Description.Length, 50, 160);
Assert.Contains($"href=\"{AskCloseHtml.ResumeAddress}\"", body);
foreach (string profile in AboutPage.Profiles)
{
Assert.Contains($"href=\"{profile}\"", body);
}
Assert.DoesNotMatch("<link[^>]+rel=\"stylesheet\"", body);
Assert.DoesNotMatch("<script[^>]+src=", body);
Assert.DoesNotContain("fonts.g", body, StringComparison.Ordinal);
Assert.DoesNotContain("\u2014", body, StringComparison.Ordinal);
Match data = Regex.Match(body, "<script type=\"application/ld\\+json\">(.*?)</script>", RegexOptions.Singleline);
Assert.True(data.Success, "/about should carry its structured data");
using var person = JsonDocument.Parse(data.Groups[1].Value);
JsonElement root = person.RootElement;
Assert.Equal("Person", root.GetProperty("@type").GetString());
Assert.Equal("Steven Stout", root.GetProperty("name").GetString());
Assert.Equal(AboutPage.JobTitle, root.GetProperty("jobTitle").GetString());
Assert.Equal(AboutPage.SameAs, root.GetProperty("sameAs").EnumerateArray().Select(item => item.GetString()!).ToArray());
Assert.Equal([.. AboutPage.Profiles, "https://github.com/SteveStout"], AboutPage.SameAs);
Assert.Equal(AboutPage.KnowsAbout, root.GetProperty("knowsAbout").EnumerateArray().Select(item => item.GetString()!).ToArray());
Assert.Equal("CollegeOrUniversity", root.GetProperty("alumniOf").GetProperty("@type").GetString());
Assert.Equal(AboutPage.AlumniOf, root.GetProperty("alumniOf").GetProperty("name").GetString());
JsonElement address = root.GetProperty("address");
Assert.Equal("Saint Charles", address.GetProperty("addressLocality").GetString());
Assert.Equal(new[] { "@type", "addressLocality", "addressRegion", "addressCountry" }, address.EnumerateObject().Select(field => field.Name).ToArray());
Assert.False(root.TryGetProperty("email", out _) || root.TryGetProperty("telephone", out _) || root.TryGetProperty("birthDate", out _));
string text = Regex.Replace(body, "\"@(context|type|id)\"", "");
Assert.DoesNotMatch(@"[\w.+-]+@[\w-]+\.[\w.]+", text);
Assert.DoesNotMatch(@"\(?\b\d{3}\)?[ .-]\d{3}[ .-]\d{4}\b", body);
}
[Fact]
public void The_pages_the_api_draws_wear_the_site_face_from_its_own_file()
{
string assets = Path.Combine(Path.GetTempPath(), "theyard-siteface-" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(assets);
try
{
Assert.Equal(string.Empty, SiteFace.Find(assets));
File.WriteAllBytes(Path.Combine(assets, "ibm-plex-sans-latin-BgnScaL7.woff2"), [0]);
string face = SiteFace.Find(assets);
Assert.Contains("url('/assets/ibm-plex-sans-latin-BgnScaL7.woff2') format('woff2')", face);
Assert.Contains("font-family: 'IBM Plex Sans'", face);
Assert.Contains(face, AboutPage.Render("https://theyard.stevenstout.biz/", AboutPage.LeadImage, face));
Assert.Contains(face, DiagramPage.Render("A drawing", "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>", "docs/images/a.svg", face));
}
finally
{
Directory.Delete(assets, true);
}
Assert.Equal(string.Empty, SiteFace.Find(Path.Combine(assets, "gone")));
Assert.DoesNotContain("fonts.googleapis.com", DiagramPage.Render("A drawing", "<svg></svg>", "docs/images/a.svg"));
Assert.DoesNotContain("@font-face", AboutPage.Render("https://theyard.stevenstout.biz/"));
}
[Fact]
public void Each_site_names_itself_on_the_about_page()
{
string page = AboutPage.Render("https://theyard-cosmos.stevenstout.biz/");
Assert.Contains("<link rel=\"canonical\" href=\"https://theyard-cosmos.stevenstout.biz/about\">", page);
Assert.Contains("property=\"og:url\" content=\"https://theyard-cosmos.stevenstout.biz/about\"", page);
Assert.Contains("\"url\":\"https://theyard-cosmos.stevenstout.biz/\"", page);
}
[Fact]
public void The_about_page_says_how_he_leads_and_links_each_habit_to_its_proof()
{
string page = AboutPage.Render("https://theyard.stevenstout.biz/");
Assert.Contains("<h2 id=\"how-i-lead\">How I lead</h2>", page);
foreach (string habit in new[] { "Decisions written down.", "Tests that guard the business.", "Tradeoffs in the open.", "Coaching inside the system." })
{
Assert.Contains($"<strong>{habit}</strong>", page);
}
Assert.Contains("href=\"https://github.com/SteveStout/TheYard/tree/main/docs\"", page);
Assert.Contains("href=\"https://github.com/SteveStout/TheYard/blob/main/data/test-results.json\"", page);
Assert.Contains("href=\"https://github.com/SteveStout/TheYard/blob/main/docs/decisions/ADR-059-a-second-store-priced.md\"", page);
Assert.Contains($"<img src=\"{AboutPage.LeadImage}\"", page);
Assert.Contains("width=\"960\" height=\"540\"", page);
Assert.DoesNotContain("<figure class=\"lead-image\"", AboutPage.Render("https://theyard.stevenstout.biz/", null));
string pictured = AboutPage.Render("https://theyard.stevenstout.biz/", "/about-lead.webp");
Assert.Contains($"<figure class=\"lead-image\"><img src=\"/about-lead.webp\" alt=\"{AboutPage.LeadImageAlt}\"", pictured);
Assert.Contains("<h2 id=\"the-workshop\">The workshop</h2>", page);
Assert.Contains($"<p>{System.Net.WebUtility.HtmlEncode(AboutPage.Workshop)}</p>", page);
Assert.Contains($"<img src=\"{AboutPage.WorkshopImage}\" alt=\"Wooden birdhouse with a teal roof\" width=\"600\" height=\"600\"", page);
Assert.True(File.Exists(Path.Combine(Repo.Root(), "public", AboutPage.WorkshopImage.TrimStart('/'))), "the birdhouse drawing should be in public/");
Assert.DoesNotMatch(@"(?i)\b(age \d|aged \d|\d+ years? old|since \d{4}|\d+ years of woodworking)", AboutPage.Workshop);
}
Live from api/TheYard.Tests/DiagramPageTests.cs, region page-tests, read from this build at 99df7a8.
Addendum, 2026-09-29 (1.0.3.47): a page about him, on the same pattern
A search for his name with ".NET" or "Azure" found his LinkedIn and not this site. The site had a head that described the auction and a structured-data block naming him only as the author of the code, and no page whose subject was him. /about is that page, served by the API the way a diagram is: one small HTML document, api/TheYard.Api/Features/Docs/AboutPage.cs, with the palette inline, a viewport line, selectable text, and nothing fetched from another host, the font included (the diagram pages still ask Google for theirs; this one uses the reader's own copy of the face or the system's). Outside /api because it is a page a search engine lists; a literal route wins over the app's fallback, and the dev server proxies it to the API like /api.
What it says comes from the served resume and the README and nothing else: his name as the heading, the resume's title line under it, the resume's summary tightened to one paragraph, one paragraph on what TheYard is with links to the Performance page, the decision records, the API reference and the gate's test record, and three links out: LinkedIn, the repository and the resume. Its head is its own: a title and description written for a search result, a canonical, Open Graph and Twitter tags, and a schema.org Person. Each container names itself from Site:Url, so the Cosmos DB site's page says its own address; with none set (a developer's machine, the test host) the request's address is used.
The Person says his name, the resume's title, the site, the two profiles that are him (sameAs) and his city, Saint Charles, Missouri, and nothing else: no street, no postcode, no email, no phone. index.html carries the same Person in a graph beside the SoftwareSourceCode node it already had, whose author now points at it by id. The sitemap lists /about at priority 0.9 with a lastmod the Dockerfile writes on the day the image is built, and the About section of the sidebar opens with it, in a new tab like every served page. Search Console's HTML-tag check has a slot: a comment in index.html that the image build replaces with the meta tag when the repository variable GOOGLE_SITE_VERIFICATION is set, and leaves alone when it is not. It ships empty.
Held by DiagramPageTests (the page, its head, what the Person may and may not say, each site naming itself), PublicFaceTests (the head's Person and slot, the sitemap row) and DockerBuildInputsTests (the stamp and the tag, and the variable passed to both builds of the image).