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>
36 lines
896 B
Go
36 lines
896 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
|
|
"git.dev.alexdunmow.com/block/core/blocks"
|
|
)
|
|
|
|
// FooterBlockMeta defines metadata for the Coffee footer block.
|
|
var FooterBlockMeta = blocks.BlockMeta{
|
|
Key: "footer",
|
|
Title: "Footer",
|
|
Description: "Torn-edge footer with optional location summary and newsletter caption",
|
|
Source: "coffee",
|
|
}
|
|
|
|
// FooterBlock renders the coffee footer.
|
|
// Content shape: {"showLocation": "true", "newsletterText": "..."}
|
|
func FooterBlock(ctx context.Context, content map[string]any) string {
|
|
data := FooterData{
|
|
ShowLocation: getBool(content, "showLocation", true),
|
|
NewsletterText: getString(content, "newsletterText"),
|
|
}
|
|
|
|
var buf bytes.Buffer
|
|
_ = footerComponent(data).Render(ctx, &buf)
|
|
return buf.String()
|
|
}
|
|
|
|
// FooterData holds the data for the footer component.
|
|
type FooterData struct {
|
|
ShowLocation bool
|
|
NewsletterText string
|
|
}
|