Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/brutalist. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
37 lines
917 B
Go
37 lines
917 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
|
|
"git.dev.alexdunmow.com/block/core/blocks"
|
|
)
|
|
|
|
// PullQuoteBlockMeta defines the Pull Quote block.
|
|
var PullQuoteBlockMeta = blocks.BlockMeta{
|
|
Key: "pull_quote",
|
|
Title: "Pull Quote",
|
|
Description: "Massive quote spanning 8 columns with hairline rules above and below",
|
|
Category: blocks.CategoryContent,
|
|
Source: "brutalist",
|
|
}
|
|
|
|
// PullQuoteData carries data for the pull-quote component.
|
|
type PullQuoteData struct {
|
|
Quote string
|
|
Attribution string
|
|
}
|
|
|
|
// PullQuoteBlock renders the pull quote.
|
|
// Content: {"quote": "<rich html>", "attribution": "..."}
|
|
func PullQuoteBlock(ctx context.Context, content map[string]any) string {
|
|
data := PullQuoteData{
|
|
Quote: getString(content, "quote"),
|
|
Attribution: getString(content, "attribution"),
|
|
}
|
|
|
|
var buf bytes.Buffer
|
|
_ = pullQuoteComponent(data).Render(ctx, &buf)
|
|
return buf.String()
|
|
}
|