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>
38 lines
1013 B
Go
38 lines
1013 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
|
|
"git.dev.alexdunmow.com/block/core/blocks"
|
|
)
|
|
|
|
// MastheadBlockMeta is the issue-masthead (wordmark + folio bar) at the top of the page.
|
|
var MastheadBlockMeta = blocks.BlockMeta{
|
|
Key: "masthead",
|
|
Title: "Issue Masthead",
|
|
Description: "Wordmark, issue number and tagline strip — sits at the top of every page.",
|
|
Source: "magazine-bold",
|
|
Category: blocks.CategoryLayout,
|
|
}
|
|
|
|
// MastheadData is what the templ component consumes.
|
|
type MastheadData struct {
|
|
IssueNo string
|
|
Tagline string
|
|
Date string
|
|
}
|
|
|
|
// MastheadBlock renders the issue masthead.
|
|
// content keys: issueNo, tagline, date — all optional, no panic on empty.
|
|
func MastheadBlock(ctx context.Context, content map[string]any) string {
|
|
data := MastheadData{
|
|
IssueNo: getString(content, "issueNo"),
|
|
Tagline: getString(content, "tagline"),
|
|
Date: getString(content, "date"),
|
|
}
|
|
var buf bytes.Buffer
|
|
_ = mastheadComponent(data).Render(ctx, &buf)
|
|
return buf.String()
|
|
}
|