Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/coffee. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
20 lines
505 B
Go
20 lines
505 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
)
|
|
|
|
// CoffeeImageBlock renders an image with the torn-edge frame and optional
|
|
// handwritten caption.
|
|
// Content shape: {"src": "...", "alt": "...", "caption": "..."}
|
|
func CoffeeImageBlock(ctx context.Context, content map[string]any) string {
|
|
src := getString(content, "src")
|
|
alt := getString(content, "alt")
|
|
caption := getString(content, "caption")
|
|
|
|
var buf bytes.Buffer
|
|
_ = coffeeImageComponent(src, alt, caption).Render(ctx, &buf)
|
|
return buf.String()
|
|
}
|