Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/earthen. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
34 lines
869 B
Go
34 lines
869 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
)
|
|
|
|
// EarthenCardBlock renders a card with softer radius and ink-edge border.
|
|
// Content expects: {"title":"…","body":"…","image":"…","link":"…","linkLabel":"…"}
|
|
func EarthenCardBlock(ctx context.Context, content map[string]any) string {
|
|
data := EarthenCardData{
|
|
Title: getString(content, "title"),
|
|
Body: getString(content, "body"),
|
|
Image: getString(content, "image"),
|
|
Link: getString(content, "link"),
|
|
LinkLabel: getString(content, "linkLabel"),
|
|
Empty: len(content) == 0,
|
|
}
|
|
|
|
var buf bytes.Buffer
|
|
_ = earthenCardComponent(data).Render(ctx, &buf)
|
|
return buf.String()
|
|
}
|
|
|
|
// EarthenCardData is the data shape for the card override component.
|
|
type EarthenCardData struct {
|
|
Title string
|
|
Body string
|
|
Image string
|
|
Link string
|
|
LinkLabel string
|
|
Empty bool
|
|
}
|