package main import ( "context" "git.dev.alexdunmow.com/block/core/templates/bn" ) // PageData captures parsed template data for the Corporate Modernist page renderers. type PageData struct { Title string Slots map[string]string ThemeMode string ThemeCSS string SiteSettings bn.SiteSettingsData PageMeta bn.PageMeta StructuredData string CSSHash string PageviewNonce string EngagementConfig bn.EngagementConfig } // parseCMPageData adapts the runtime doc map into PageData. func parseCMPageData(doc map[string]any) PageData { title := "Untitled" if t, ok := doc["title"].(string); ok { title = t } slots := make(map[string]string) if s, ok := doc["slots"].(map[string]string); ok { slots = s } themeCSS := "" if tc, ok := doc["theme_css"].(string); ok { themeCSS = tc } structuredData := "" if sd, ok := doc["structured_data"].(string); ok { structuredData = sd } cssHash := "" if ch, ok := doc["css_hash"].(string); ok { cssHash = ch } pageviewNonce := "" if pn, ok := doc["pageview_nonce"].(string); ok { pageviewNonce = pn } themeMode := "light" if tm, ok := doc["theme_mode"].(string); ok && tm != "" { themeMode = tm } return PageData{ Title: title, Slots: slots, ThemeMode: themeMode, ThemeCSS: themeCSS, SiteSettings: bn.ParseSiteSettings(doc), PageMeta: bn.ParsePageMeta(doc), StructuredData: structuredData, CSSHash: cssHash, PageviewNonce: pageviewNonce, EngagementConfig: bn.ParseEngagementConfig(doc), } } // pluginStyles points at the embedded plugin CSS served via /templates//style.css. func pluginStyles() []string { return []string{"/templates/corporate-modernist/style.css"} } // Default — header + 12-col main + footer, capped at 1280px. templ CorporateModernistDefault(data PageData) { @bn.Head(bn.HeadData{ Title: data.Title, Settings: data.SiteSettings, PageMeta: data.PageMeta, ThemeMode: data.ThemeMode, ThemeCSS: data.ThemeCSS, PluginStyles: pluginStyles(), StructuredData: data.StructuredData, CSSHash: data.CSSHash, PageviewNonce: data.PageviewNonce, EngagementConfig: data.EngagementConfig, }) @bn.AdminBypassBanner(data.SiteSettings)
@templ.Raw(data.Slots["header"])
if main, ok := data.Slots["main"]; ok && main != "" { @templ.Raw(main) } else {

No content blocks assigned to this page.

}
@bn.BodyEnd(data.SiteSettings) } // Landing — hero band + main + closing CTA + footer. templ CorporateModernistLanding(data PageData) { @bn.Head(bn.HeadData{ Title: data.Title, Settings: data.SiteSettings, PageMeta: data.PageMeta, ThemeMode: data.ThemeMode, ThemeCSS: data.ThemeCSS, PluginStyles: pluginStyles(), StructuredData: data.StructuredData, CSSHash: data.CSSHash, PageviewNonce: data.PageviewNonce, EngagementConfig: data.EngagementConfig, }) @bn.AdminBypassBanner(data.SiteSettings)
@templ.Raw(data.Slots["header"])
@templ.Raw(data.Slots["hero"])
if main, ok := data.Slots["main"]; ok && main != "" {
@templ.Raw(main)
}
@templ.Raw(data.Slots["cta"])
@bn.BodyEnd(data.SiteSettings) } // Article — centered measure for long-form thought leadership. templ CorporateModernistArticle(data PageData) { @bn.Head(bn.HeadData{ Title: data.Title, Settings: data.SiteSettings, PageMeta: data.PageMeta, ThemeMode: data.ThemeMode, ThemeCSS: data.ThemeCSS, PluginStyles: pluginStyles(), StructuredData: data.StructuredData, CSSHash: data.CSSHash, PageviewNonce: data.PageviewNonce, EngagementConfig: data.EngagementConfig, }) @bn.AdminBypassBanner(data.SiteSettings)
@templ.Raw(data.Slots["header"])
if main, ok := data.Slots["main"]; ok && main != "" { @templ.Raw(main) } else {

No article content yet.

}
if aside, ok := data.Slots["aside"]; ok && aside != "" { }
@bn.BodyEnd(data.SiteSettings) } // Full width — edge-to-edge sections, internal grid kept. templ CorporateModernistFullWidth(data PageData) { @bn.Head(bn.HeadData{ Title: data.Title, Settings: data.SiteSettings, PageMeta: data.PageMeta, ThemeMode: data.ThemeMode, ThemeCSS: data.ThemeCSS, PluginStyles: pluginStyles(), StructuredData: data.StructuredData, CSSHash: data.CSSHash, PageviewNonce: data.PageviewNonce, EngagementConfig: data.EngagementConfig, }) @bn.AdminBypassBanner(data.SiteSettings)
@templ.Raw(data.Slots["header"])
if main, ok := data.Slots["main"]; ok && main != "" { @templ.Raw(main) } else {

No content blocks assigned to this page.

}
@bn.BodyEnd(data.SiteSettings) } // RenderCM is the page-template render entry point for `default`. func RenderCM(ctx context.Context, doc map[string]any) templ.Component { return CorporateModernistDefault(parseCMPageData(doc)) } // RenderCMLanding is the page-template render entry point for `landing`. func RenderCMLanding(ctx context.Context, doc map[string]any) templ.Component { return CorporateModernistLanding(parseCMPageData(doc)) } // RenderCMArticle is the page-template render entry point for `article`. func RenderCMArticle(ctx context.Context, doc map[string]any) templ.Component { return CorporateModernistArticle(parseCMPageData(doc)) } // RenderCMFullWidth is the page-template render entry point for `full-width`. func RenderCMFullWidth(ctx context.Context, doc map[string]any) templ.Component { return CorporateModernistFullWidth(parseCMPageData(doc)) }