GerbilManagerWebAPI/Cms/SiteRenderer.cs:
- Render(JsonObject snapshot) -> IReadOnlyDictionary<string,string> (path->content)
- Covers all 6 block types: Heading, RichText, Image, Gallery, ContactInfo,
AbgabetiereList (auto-resolved animals from snapshot; empty placeholder)
- start -> index.html; other slugs -> {slug}/index.html; assets/site.css
- Draft pages excluded; nav links with aria-current for current page
- Minimal Markdown->HTML (headings, bold, italic, code, links, ul/ol) --
no extra dependencies, deterministic output
- H() encodes only the 5 HTML special chars (not umlauts) for UTF-8 pages
- Mobile-first CSS: site header+nav, animal card grid, responsive breakpoints,
warm off-white palette (style reference: Jimdo Kleine Chaoten)
GerbilManagerWebAPI/Endpoints/CmsEndpoints.cs:
- GET /api/render-site -- dry-run: returns [{path, size}] for each rendered file
GerbilManager.Tests/SiteRendererTests.cs:
- 21 unit tests (pure JsonObject, no DB): file paths, HTML structure, each block
type, draft exclusion, XSS encoding, all 6 seeded pages, Markdown inline tests
- 1 integration test (ApiFactory): /api/render-site returns CSS + index.html
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
12 KiB
12 KiB