package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // MerchCardBlockMeta declares the merch product card block. var MerchCardBlockMeta = blocks.BlockMeta{ Key: "merch_card", Title: "Merch Card", Description: "Plastic-bevel product card with a corner sticker badge.", Source: "y2k", Category: blocks.CategoryContent, } // MerchCardBlock renders the merch card. // Content: {title, price, image, buyHref, sticker} func MerchCardBlock(ctx context.Context, content map[string]any) string { data := MerchCardData{ Title: getString(content, "title"), Price: getString(content, "price"), Image: getString(content, "image"), BuyHref: getString(content, "buyHref"), Sticker: getString(content, "sticker"), } var buf bytes.Buffer _ = merchCardComponent(data).Render(ctx, &buf) return buf.String() } // MerchCardData is the typed shape for the templ component. type MerchCardData struct { Title string Price string Image string BuyHref string Sticker string }