themes-coffee/image_override.go
Alex Dunmow 11c6c8c63e initial: theme plugin coffee
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>
2026-06-06 14:11:22 +08:00

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()
}