No content blocks assigned to this page.
package main import ( "context" "git.dev.alexdunmow.com/block/core/templates/bn" ) // PageData carries the rendered slots and assorted page chrome data passed // from the CMS into a Cyberpunk page template. 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 } // parseCyberpunkPageData converts the loose doc map the renderer is handed into a typed PageData. func parseCyberpunkPageData(doc map[string]any) PageData { title := "Untitled" if t, ok := doc["title"].(string); ok && t != "" { title = t } slots := map[string]string{} if s, ok := doc["slots"].(map[string]string); ok { slots = s } themeCSS, _ := doc["theme_css"].(string) structuredData, _ := doc["structured_data"].(string) cssHash, _ := doc["css_hash"].(string) pageviewNonce, _ := doc["pageview_nonce"].(string) themeMode := "dark" 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), } } // scanlineOverlay renders the global scanline overlay element (fixed, pointer-events: none). templ scanlineOverlay() {
} // Cyberpunk renders the default page template. templ Cyberpunk(data PageData) { @bn.Head(bn.HeadData{ Title: data.Title, Settings: data.SiteSettings, PageMeta: data.PageMeta, ThemeMode: data.ThemeMode, ThemeCSS: data.ThemeCSS, PluginStyles: []string{"/templates/cyberpunk/css/cyberpunk.css"}, StructuredData: data.StructuredData, CSSHash: data.CSSHash, PageviewNonce: data.PageviewNonce, EngagementConfig: data.EngagementConfig, }) @bn.AdminBypassBanner(data.SiteSettings) @scanlineOverlay()No content blocks assigned to this page.
No content blocks assigned to this page.