package templates import ( "context" "io" ) // PageDocument is a full-page template's contribution to the document. The // HOST owns the envelope (doctype/// and the bn chrome); // the guest supplies the body interior and envelope attributes. PageDocument // is itself an HTMLComponent (renders Body), so TemplateFunc's signature is // unchanged and non-page callers need no adaptation. type PageDocument struct { Body HTMLComponent BodyClass string Lang string // ; empty means host default "en" HTMLAttrs map[string]string // extra attributes (e.g. data-theme) HeadExtra HTMLComponent // appended inside after bn.Head BodyEndExtra HTMLComponent // appended before after bn.BodyEnd } func (p *PageDocument) Render(ctx context.Context, w io.Writer) error { if p.Body == nil { return nil } return p.Body.Render(ctx, w) }