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>
36 lines
945 B
Go
36 lines
945 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
|
|
"git.dev.alexdunmow.com/block/core/blocks"
|
|
)
|
|
|
|
// ColophonBlockMeta is the mono caption strip with credits and optional social row.
|
|
var ColophonBlockMeta = blocks.BlockMeta{
|
|
Key: "colophon",
|
|
Title: "Colophon",
|
|
Description: "Mono caption strip with credits and an optional social row.",
|
|
Source: "magazine-bold",
|
|
Category: blocks.CategoryLayout,
|
|
}
|
|
|
|
// ColophonData is what the templ component consumes.
|
|
type ColophonData struct {
|
|
Credits string
|
|
ShowSocial bool
|
|
}
|
|
|
|
// ColophonBlock renders the colophon strip.
|
|
// content keys: credits (richtext), showSocial (select "true"/"false").
|
|
func ColophonBlock(ctx context.Context, content map[string]any) string {
|
|
data := ColophonData{
|
|
Credits: getString(content, "credits"),
|
|
ShowSocial: getBool(content, "showSocial", false),
|
|
}
|
|
var buf bytes.Buffer
|
|
_ = colophonComponent(data).Render(ctx, &buf)
|
|
return buf.String()
|
|
}
|