package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // CaseStudyBlockMeta defines the Noir long-form project case study block. var CaseStudyBlockMeta = blocks.BlockMeta{ Key: "case_study", Title: "Project Case Study", Description: "Long-form project spread with sticky meta rail and image-led prose.", Source: "noir", Category: blocks.CategoryLayout, } // CaseStudyBlock renders a project case study. // Content shape: {"title":"...","client":"...","year":2025,"credits":["...","..."],"images":["...","..."]} func CaseStudyBlock(ctx context.Context, content map[string]any) string { data := CaseStudyData{ Title: getString(content, "title"), Client: getString(content, "client"), Year: getInt(content, "year", 0), Credits: getStringSlice(content, "credits"), } for _, img := range getStringSlice(content, "images") { if img == "" { continue } data.Images = append(data.Images, blocks.ResolveMediaPath(img)) } var buf bytes.Buffer _ = caseStudyComponent(data).Render(ctx, &buf) return buf.String() } // CaseStudyData holds the parsed view-model for the case study block. type CaseStudyData struct { Title string Client string Year int Credits []string Images []string }