package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // FeatureGridSoftMeta defines the three-up soft feature grid. var FeatureGridSoftMeta = blocks.BlockMeta{ Key: "feature-grid-soft", Title: "Feature Trio", Description: "Three-up card grid for services, offerings, or core values.", Source: "pastel-dream", Category: blocks.CategoryLayout, } // FeatureGridSoftBlock renders the feature grid. // Content shape: {intro, items: [{icon, title, body}]} func FeatureGridSoftBlock(ctx context.Context, content map[string]any) string { rawItems := getSlice(content, "items") items := make([]FeatureSoftItem, 0, len(rawItems)) for _, it := range rawItems { items = append(items, FeatureSoftItem{ Icon: getString(it, "icon"), Title: getString(it, "title"), Body: getString(it, "body"), }) } data := FeatureGridSoftData{ Intro: getString(content, "intro"), Items: items, } var buf bytes.Buffer _ = featureGridSoftComponent(data).Render(ctx, &buf) return buf.String() } // FeatureGridSoftData is the rendered view of the feature-grid-soft block. type FeatureGridSoftData struct { Intro string Items []FeatureSoftItem } // FeatureSoftItem is a single card in the trio. type FeatureSoftItem struct { Icon string Title string Body string }