package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // ColophonBlockMeta is the mono caption strip with credits and optional social row. var ColophonBlockMeta = blocks.BlockMeta{ Key: "colophon", Title: "Colophon", Description: "Mono caption strip with credits and an optional social row.", Source: "magazine-bold", Category: blocks.CategoryLayout, } // ColophonData is what the templ component consumes. type ColophonData struct { Credits string ShowSocial bool } // ColophonBlock renders the colophon strip. // content keys: credits (richtext), showSocial (select "true"/"false"). func ColophonBlock(ctx context.Context, content map[string]any) string { data := ColophonData{ Credits: getString(content, "credits"), ShowSocial: getBool(content, "showSocial", false), } var buf bytes.Buffer _ = colophonComponent(data).Render(ctx, &buf) return buf.String() }