package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // PullquoteBlockMeta describes the Editorial pull-quote block: a large oxblood // Playfair italic block quote with optional attribution. // Registered as "editorial:pullquote" at runtime. var PullquoteBlockMeta = blocks.BlockMeta{ Key: "pullquote", Title: "Pull Quote", Description: "Large oxblood pull quote in Playfair italic", Source: "editorial", Category: blocks.CategoryTheme, } // PullquoteData carries parsed pull-quote content. type PullquoteData struct { Quote string // rich-text payload, trusted upstream Attribution string } // PullquoteBlock renders the pull quote. // // Content shape: // // { // "quote": "
The reform was always going to be quiet.
", // "attribution": "— The Editor" // } func PullquoteBlock(ctx context.Context, content map[string]any) string { data := PullquoteData{ Quote: getString(content, "quote"), Attribution: getString(content, "attribution"), } if data.Quote == "" { return "" } var buf bytes.Buffer _ = pullquoteComponent(data).Render(ctx, &buf) return buf.String() }