package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // FieldNoteBlockMeta defines metadata for the field note block. var FieldNoteBlockMeta = blocks.BlockMeta{ Key: "field_note", Title: "Field Note", Description: "Article-style dispatch from the field with byline and location", Source: "earthen", Category: blocks.CategoryContent, } // FieldNoteBlock renders the field note block. // Content shape: {author, location, dateline, body, image} func FieldNoteBlock(ctx context.Context, content map[string]any) string { data := FieldNoteData{ Author: getString(content, "author"), Location: getString(content, "location"), Dateline: getString(content, "dateline"), Body: getString(content, "body"), Image: getString(content, "image"), Empty: len(content) == 0, } var buf bytes.Buffer _ = fieldNoteComponent(data).Render(ctx, &buf) return buf.String() } // FieldNoteData contains data for the field note component. type FieldNoteData struct { Author string Location string Dateline string Body string Image string Empty bool }