themes-pastel-dream/cozy_footer.go
Alex Dunmow de55bbebd6 initial: theme plugin pastel-dream
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/pastel-dream.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 14:11:41 +08:00

41 lines
1.1 KiB
Go

package main
import (
"bytes"
"context"
"git.dev.alexdunmow.com/block/core/blocks"
)
// CozyFooterMeta defines the footer block.
var CozyFooterMeta = blocks.BlockMeta{
Key: "cozy-footer",
Title: "Cozy Footer",
Description: "Newsletter signup, closing affirmation, menu column, and social pills.",
Source: "pastel-dream",
Category: blocks.CategoryNavigation,
}
// CozyFooterBlock renders the footer.
// Content shape: {showSignup, affirmation, menuName, social[]}
func CozyFooterBlock(ctx context.Context, content map[string]any) string {
data := CozyFooterData{
ShowSignup: getBoolish(content, "showSignup", true),
Affirmation: getStringOr(content, "affirmation", "Be gentle with yourself today."),
MenuName: getString(content, "menuName"),
Social: getStringSlice(content, "social"),
}
var buf bytes.Buffer
_ = cozyFooterComponent(data).Render(ctx, &buf)
return buf.String()
}
// CozyFooterData is the rendered view of the cozy-footer block.
type CozyFooterData struct {
ShowSignup bool
Affirmation string
MenuName string
Social []string
}