Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/magazine-bold. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
24 lines
720 B
Go
24 lines
720 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
|
|
"git.dev.alexdunmow.com/block/core/blocks"
|
|
)
|
|
|
|
// ImageOverrideBlock renders the built-in image block with the Magazine Bold
|
|
// treatment: optional full-bleed mode + a mono caption folio.
|
|
//
|
|
// Built-in image content shape: {"src": "...", "alt": "...", "caption": "...", "fullBleed": true/false}
|
|
func ImageOverrideBlock(ctx context.Context, content map[string]any) string {
|
|
src := blocks.ResolveMediaPath(getString(content, "src"))
|
|
alt := getString(content, "alt")
|
|
caption := getString(content, "caption")
|
|
fullBleed := getBool(content, "fullBleed", false)
|
|
|
|
var buf bytes.Buffer
|
|
_ = mbImageComponent(src, alt, caption, fullBleed).Render(ctx, &buf)
|
|
return buf.String()
|
|
}
|