package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // MastheadBlockMeta defines the Studio Masthead block. var MastheadBlockMeta = blocks.BlockMeta{ Key: "masthead", Title: "Studio Masthead", Description: "Oversized studio wordmark with mono index counter top-right", Category: blocks.CategoryLayout, Source: "brutalist", } // MastheadData carries display data for the masthead component. type MastheadData struct { StudioName string Tagline string IndexNumber string } // MastheadBlock renders the studio masthead. // Content: {"studioName": "...", "tagline": "...", "indexNumber": "01 / 14"} func MastheadBlock(ctx context.Context, content map[string]any) string { data := MastheadData{ StudioName: getString(content, "studioName"), Tagline: getString(content, "tagline"), IndexNumber: getString(content, "indexNumber"), } if data.StudioName == "" { data.StudioName = "STUDIO" } if data.IndexNumber == "" { data.IndexNumber = "01 / 14" } var buf bytes.Buffer _ = mastheadComponent(data).Render(ctx, &buf) return buf.String() }