package main import ( "bytes" "context" ) // Y2KImageBlock applies the chrome-bordered image frame to the built-in // image block. // Content: {url, alt, caption, class} func Y2KImageBlock(ctx context.Context, content map[string]any) string { data := Y2KImageData{ URL: getString(content, "url"), Alt: getString(content, "alt"), Caption: getString(content, "caption"), Class: getString(content, "class"), } if data.URL == "" { return "" } var buf bytes.Buffer _ = y2kImageComponent(data).Render(ctx, &buf) return buf.String() } // Y2KImageData is the typed shape for the templ component. type Y2KImageData struct { URL string Alt string Caption string Class string }