package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // PullQuoteBlockMeta is the color-block pull quote. var PullQuoteBlockMeta = blocks.BlockMeta{ Key: "pull_quote", Title: "Pull Quote", Description: "Color-block pull quote with rotating accent (pink / blue / lime).", Source: "magazine-bold", Category: blocks.CategoryContent, } // PullQuoteData is what the templ component consumes. type PullQuoteData struct { Quote string Attribution string Accent string } // PullQuoteBlock renders the color-block pull quote. // content keys: quote (richtext), attribution (text), accent (select). func PullQuoteBlock(ctx context.Context, content map[string]any) string { data := PullQuoteData{ Quote: getString(content, "quote"), Attribution: getString(content, "attribution"), Accent: normalizeAccent(getString(content, "accent")), } var buf bytes.Buffer _ = pullQuoteComponent(data).Render(ctx, &buf) return buf.String() }