themes-corporate-modernist/testimonial_quote.go
Alex Dunmow 4713787bbd initial: theme plugin corporate-modernist
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/corporate-modernist.

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

44 lines
1.2 KiB
Go

package main
import (
"bytes"
"context"
"git.dev.alexdunmow.com/block/core/blocks"
)
// TestimonialQuoteMeta is the block metadata for corporate-modernist:testimonial_quote.
var TestimonialQuoteMeta = blocks.BlockMeta{
Key: "testimonial_quote",
Title: "Testimonial",
Description: "Pull-quote testimonial with attribution, headshot, and company mark.",
Source: "corporate-modernist",
Category: blocks.CategoryContent,
}
// TestimonialQuoteData carries the parsed content for the testimonial_quote block.
type TestimonialQuoteData struct {
Quote string
Name string
Role string
Company string
Headshot string
Logo string
}
// TestimonialQuoteBlock renders the testimonial_quote block.
func TestimonialQuoteBlock(ctx context.Context, content map[string]any) string {
data := TestimonialQuoteData{
Quote: getString(content, "quote"),
Name: getString(content, "name"),
Role: getString(content, "role"),
Company: getString(content, "company"),
Headshot: getString(content, "headshot"),
Logo: getString(content, "logo"),
}
var buf bytes.Buffer
_ = testimonialQuoteComponent(data).Render(ctx, &buf)
return buf.String()
}