From 8ea1477d37b26ef3dbf5cd1a1bfd371ae05f0e7c Mon Sep 17 00:00:00 2001 From: Alex Dunmow Date: Sat, 4 Jul 2026 15:26:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20convert=20to=20codeless=20.bnp=20?= =?UTF-8?q?=E2=80=94=20templates=20+=20manifest,=20Go/templ=20deleted=20(W?= =?UTF-8?q?O-WZ-021)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- Makefile | 40 +- assets/{css/cyberpunk.css => style.css} | 0 blocks/blocks.yaml | 48 ++ blocks/code_neon.ninjatpl | 1 + {schemas => blocks}/code_neon.schema.json | 0 blocks/cta_terminal.ninjatpl | 1 + {schemas => blocks}/cta_terminal.schema.json | 0 blocks/feature_card_neon.ninjatpl | 1 + .../feature_card_neon.schema.json | 0 blocks/footer_grid.ninjatpl | 1 + {schemas => blocks}/footer_grid.schema.json | 0 blocks/hero_glitch.ninjatpl | 1 + {schemas => blocks}/hero_glitch.schema.json | 0 blocks/navbar_terminal.ninjatpl | 1 + .../navbar_terminal.schema.json | 0 blocks/stats_glow.ninjatpl | 1 + {schemas => blocks}/stats_glow.schema.json | 0 button_override.go | 18 - button_override.templ | 36 -- button_override_templ.go | 134 ----- card_override.go | 18 - card_override.templ | 44 -- card_override_templ.go | 156 ------ code_neon.go | 39 -- code_neon.templ | 25 - code_neon_templ.go | 112 ---- cta_terminal.go | 41 -- cta_terminal.templ | 37 -- cta_terminal_templ.go | 113 ---- email_wrapper.templ | 102 ---- email_wrapper_templ.go | 246 --------- embed.go | 60 -- feature_card_neon.go | 51 -- feature_card_neon.templ | 37 -- feature_card_neon_templ.go | 138 ----- footer_grid.go | 62 --- footer_grid.templ | 77 --- footer_grid_templ.go | 199 ------- go.mod | 20 - go.sum | 46 -- heading_override.go | 18 - heading_override.templ | 81 --- heading_override_templ.go | 352 ------------ helpers.go | 102 ---- hero_glitch.go | 55 -- hero_glitch.templ | 54 -- hero_glitch_templ.go | 191 ------- main.go | 17 - manifest.yaml | 277 ++++++++++ master_pages.json | 33 ++ navbar_terminal.go | 43 -- navbar_terminal.templ | 50 -- navbar_terminal_templ.go | 104 ---- plugin.mod | 5 +- register.go | 190 ------- registration.go | 26 - stats_glow.go | 43 -- stats_glow.templ | 52 -- stats_glow_templ.go | 160 ------ template.templ | 237 -------- template_templ.go | 520 ------------------ templates/cyberpunk/article.ninjatpl | 12 + templates/cyberpunk/default.ninjatpl | 12 + templates/cyberpunk/full-width.ninjatpl | 12 + templates/cyberpunk/landing.ninjatpl | 13 + templates/email/cyberpunk.ninjatpl | 50 ++ templates/overrides/cyberpunk/button.ninjatpl | 1 + templates/overrides/cyberpunk/card.ninjatpl | 1 + .../overrides/cyberpunk/heading.ninjatpl | 1 + templates/overrides/cyberpunk/text.ninjatpl | 1 + text_override.go | 16 - text_override.templ | 12 - text_override_templ.go | 68 --- 73 files changed, 487 insertions(+), 4228 deletions(-) rename assets/{css/cyberpunk.css => style.css} (100%) create mode 100644 blocks/blocks.yaml create mode 100644 blocks/code_neon.ninjatpl rename {schemas => blocks}/code_neon.schema.json (100%) create mode 100644 blocks/cta_terminal.ninjatpl rename {schemas => blocks}/cta_terminal.schema.json (100%) create mode 100644 blocks/feature_card_neon.ninjatpl rename {schemas => blocks}/feature_card_neon.schema.json (100%) create mode 100644 blocks/footer_grid.ninjatpl rename {schemas => blocks}/footer_grid.schema.json (100%) create mode 100644 blocks/hero_glitch.ninjatpl rename {schemas => blocks}/hero_glitch.schema.json (100%) create mode 100644 blocks/navbar_terminal.ninjatpl rename {schemas => blocks}/navbar_terminal.schema.json (100%) create mode 100644 blocks/stats_glow.ninjatpl rename {schemas => blocks}/stats_glow.schema.json (100%) delete mode 100644 button_override.go delete mode 100644 button_override.templ delete mode 100644 button_override_templ.go delete mode 100644 card_override.go delete mode 100644 card_override.templ delete mode 100644 card_override_templ.go delete mode 100644 code_neon.go delete mode 100644 code_neon.templ delete mode 100644 code_neon_templ.go delete mode 100644 cta_terminal.go delete mode 100644 cta_terminal.templ delete mode 100644 cta_terminal_templ.go delete mode 100644 email_wrapper.templ delete mode 100644 email_wrapper_templ.go delete mode 100644 embed.go delete mode 100644 feature_card_neon.go delete mode 100644 feature_card_neon.templ delete mode 100644 feature_card_neon_templ.go delete mode 100644 footer_grid.go delete mode 100644 footer_grid.templ delete mode 100644 footer_grid_templ.go delete mode 100644 go.mod delete mode 100644 go.sum delete mode 100644 heading_override.go delete mode 100644 heading_override.templ delete mode 100644 heading_override_templ.go delete mode 100644 helpers.go delete mode 100644 hero_glitch.go delete mode 100644 hero_glitch.templ delete mode 100644 hero_glitch_templ.go delete mode 100644 main.go create mode 100644 manifest.yaml create mode 100644 master_pages.json delete mode 100644 navbar_terminal.go delete mode 100644 navbar_terminal.templ delete mode 100644 navbar_terminal_templ.go delete mode 100644 register.go delete mode 100644 registration.go delete mode 100644 stats_glow.go delete mode 100644 stats_glow.templ delete mode 100644 stats_glow_templ.go delete mode 100644 template.templ delete mode 100644 template_templ.go create mode 100644 templates/cyberpunk/article.ninjatpl create mode 100644 templates/cyberpunk/default.ninjatpl create mode 100644 templates/cyberpunk/full-width.ninjatpl create mode 100644 templates/cyberpunk/landing.ninjatpl create mode 100644 templates/email/cyberpunk.ninjatpl create mode 100644 templates/overrides/cyberpunk/button.ninjatpl create mode 100644 templates/overrides/cyberpunk/card.ninjatpl create mode 100644 templates/overrides/cyberpunk/heading.ninjatpl create mode 100644 templates/overrides/cyberpunk/text.ninjatpl delete mode 100644 text_override.go delete mode 100644 text_override.templ delete mode 100644 text_override_templ.go diff --git a/Makefile b/Makefile index bd5365d..de48791 100644 --- a/Makefile +++ b/Makefile @@ -1,26 +1,27 @@ -# cyberpunk — build & publish helpers (wasm .bnp workflow) +# cyberpunk — build & publish helpers (CODELESS .bnp workflow, WO-WZ-021) # -# The theme compiles to a wasip1 reactor-mode wasm module packed into a .bnp -# artifact (`ninja plugin build`). The legacy .so path is retired (WO-WZ-015): -# the CMS is wasm-native and can no longer load .so plugins. Distribution is -# publish-to-registry -> InstallFromRegistry (hot-load, no restart). +# This theme is a CODELESS .bnp: pure declaration the host runs — blocks +# (blocks/blocks.yaml + .ninjatpl), page/system templates, template overrides, +# an email wrapper, master pages, presets, fonts and CSS in manifest.yaml. No +# Go, no templ, no plugin.wasm, no block/core dependency. `ninja plugin build` +# classifies the repo as codeless (no Go at the root) and packs the artifact +# with manifest.pb (codeless: true) and NO plugin.wasm. # # Usage: -# make build # compile wasm + pack cyberpunk-.bnp -# make verify # validate the built .bnp (layout/abi/name/size) -# make archive-check # prove a clean `git archive HEAD` compiles to wasm +# make build # pack cyberpunk-.bnp (codeless — no wasm) +# make verify # validate the built .bnp (loader-identical checks) +# make archive-check # prove a clean `git archive HEAD` still builds codeless # make publish # ninja plugin publish --bnp (to the active registry) -# make templ # regenerate templ Go files # make clean # remove build artefacts -.PHONY: build verify archive-check publish templ clean help +.PHONY: build verify archive-check publish clean help PLUGIN_NAME := cyberpunk NINJA := ninja BNP := $(PLUGIN_NAME)-$(shell grep '^version' plugin.mod | sed 's/.*"\(.*\)"/\1/').bnp -# Compile to wasm and pack the .bnp (GOOS=wasip1 GOARCH=wasm, DESCRIBE probe, -# tar.zst of plugin.wasm + plugin.mod + manifest.pb + schemas/ + assets/). +# Pack the codeless .bnp (manifest.pb synthesized from plugin.mod + manifest.yaml +# + blocks/ + templates/; no wasm compile, no DESCRIBE probe). build: $(NINJA) plugin build --dir . @@ -28,12 +29,12 @@ build: verify: $(NINJA) plugin verify $(BNP) -# Prove a clean `git archive HEAD` (what publish ships) compiles to wasm. +# Prove a clean `git archive HEAD` (what publish ships) still packs codeless. archive-check: @T=$$(mktemp -d /tmp/archive-check-$(PLUGIN_NAME).XXXXXX) && \ trap 'rm -rf "$$T"' EXIT && \ git archive HEAD | tar -x -C "$$T" && \ - cd "$$T" && GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o "$$T/check.wasm" . && \ + cd "$$T" && $(NINJA) plugin build --dir . && \ echo "archive-check OK" # Publish the prebuilt .bnp to the active registry. @@ -41,19 +42,14 @@ archive-check: publish: build $(NINJA) plugin publish --bnp $(BNP) -# Regenerate templ Go files locally. -templ: - templ generate - # Remove build artefacts. clean: - rm -f $(PLUGIN_NAME)-*.bnp $(PLUGIN_NAME).so plugin.wasm + rm -f $(PLUGIN_NAME)-*.bnp plugin.wasm help: @echo "Targets:" - @echo " build Compile wasm + pack the .bnp" + @echo " build Pack the codeless .bnp (no wasm)" @echo " verify Validate the built .bnp (loader-identical checks)" - @echo " archive-check Prove a clean git archive HEAD compiles to wasm" + @echo " archive-check Prove a clean git archive HEAD packs codeless" @echo " publish Publish the .bnp to the active registry" - @echo " templ Regenerate templ Go files" @echo " clean Remove build artefacts" diff --git a/assets/css/cyberpunk.css b/assets/style.css similarity index 100% rename from assets/css/cyberpunk.css rename to assets/style.css diff --git a/blocks/blocks.yaml b/blocks/blocks.yaml new file mode 100644 index 0000000..becb7b9 --- /dev/null +++ b/blocks/blocks.yaml @@ -0,0 +1,48 @@ +# Cyberpunk theme block definitions (codeless .bnp, WO-WZ-021). +# Keys are fully qualified (cyberpunk:) because the codeless loader +# registers definitions verbatim — there is no PluginBlockRegistry prefixing +# in the codeless path (unlike the wasm/templ path). The qualified keys match +# the hardcoded data-block attributes and the master_pages.json references. +blocks: + - key: cyberpunk:hero_glitch + title: Glitch Hero + description: RGB-split H1, neon CTA, optional scanline overlay toggle. + category: layout + schema: hero_glitch.schema.json + template: hero_glitch.ninjatpl + - key: cyberpunk:cta_terminal + title: Terminal CTA + description: Faux $ prompt with blinking caret and copy button. + category: layout + schema: cta_terminal.schema.json + template: cta_terminal.ninjatpl + - key: cyberpunk:navbar_terminal + title: Terminal Navbar + description: Mono-spaced navbar with $ command prefix and optional status dot. + category: navigation + schema: navbar_terminal.schema.json + template: navbar_terminal.ninjatpl + - key: cyberpunk:footer_grid + title: Grid Footer + description: Mono columns, build-hash + uptime status pill. + category: navigation + schema: footer_grid.schema.json + template: footer_grid.ninjatpl + - key: cyberpunk:feature_card_neon + title: Neon Feature Card + description: Single feature card with per-card neon edge glow (magenta/cyan/lime). + category: layout + schema: feature_card_neon.schema.json + template: feature_card_neon.ninjatpl + - key: cyberpunk:stats_glow + title: Glow Stats + description: Big mono numerals with neon accent underline. + category: display + schema: stats_glow.schema.json + template: stats_glow.ninjatpl + - key: cyberpunk:code_neon + title: Code Block + description: Server-rendered code block with neon edge and optional copy button. + category: content + schema: code_neon.schema.json + template: code_neon.ninjatpl diff --git a/blocks/code_neon.ninjatpl b/blocks/code_neon.ninjatpl new file mode 100644 index 0000000..32685d8 --- /dev/null +++ b/blocks/code_neon.ninjatpl @@ -0,0 +1 @@ +
{{ language|default:'text' }}{% if copy != false and copy != "false" and copy != "off" and copy != "no" and copy != "0" and copy != "" %} {% endif %}
{{ code }}
diff --git a/schemas/code_neon.schema.json b/blocks/code_neon.schema.json similarity index 100% rename from schemas/code_neon.schema.json rename to blocks/code_neon.schema.json diff --git a/blocks/cta_terminal.ninjatpl b/blocks/cta_terminal.ninjatpl new file mode 100644 index 0000000..9b8d474 --- /dev/null +++ b/blocks/cta_terminal.ninjatpl @@ -0,0 +1 @@ +
{{ prompt|default:'$ npm i your-thing' }}
{% if button|default:'Copy' %}{{ button|default:'Copy' }}{% endif %}
diff --git a/schemas/cta_terminal.schema.json b/blocks/cta_terminal.schema.json similarity index 100% rename from schemas/cta_terminal.schema.json rename to blocks/cta_terminal.schema.json diff --git a/blocks/feature_card_neon.ninjatpl b/blocks/feature_card_neon.ninjatpl new file mode 100644 index 0000000..a8adae3 --- /dev/null +++ b/blocks/feature_card_neon.ninjatpl @@ -0,0 +1 @@ +
{% if icon %}
{% endif %}

{{ title|default:'Feature' }}

{% if body %}
{{ body|safe }}
{% endif %}
diff --git a/schemas/feature_card_neon.schema.json b/blocks/feature_card_neon.schema.json similarity index 100% rename from schemas/feature_card_neon.schema.json rename to blocks/feature_card_neon.schema.json diff --git a/blocks/footer_grid.ninjatpl b/blocks/footer_grid.ninjatpl new file mode 100644 index 0000000..f86f66f --- /dev/null +++ b/blocks/footer_grid.ninjatpl @@ -0,0 +1 @@ + diff --git a/schemas/footer_grid.schema.json b/blocks/footer_grid.schema.json similarity index 100% rename from schemas/footer_grid.schema.json rename to blocks/footer_grid.schema.json diff --git a/blocks/hero_glitch.ninjatpl b/blocks/hero_glitch.ninjatpl new file mode 100644 index 0000000..48ec8fa --- /dev/null +++ b/blocks/hero_glitch.ninjatpl @@ -0,0 +1 @@ +
{% if scanlines != false and scanlines != "false" and scanlines != "off" and scanlines != "no" and scanlines != "0" and scanlines != "" %}{% endif %}
{% if eyebrow %}

{{ eyebrow }}

{% endif %}

{{ headline|default:'// hero headline' }}

{% if sub %}

{{ sub }}

{% endif %}
{% if cta.label %}{{ cta.label }} {% endif %}{% if secondaryCta.label %}{{ secondaryCta.label }}{% endif %}
diff --git a/schemas/hero_glitch.schema.json b/blocks/hero_glitch.schema.json similarity index 100% rename from schemas/hero_glitch.schema.json rename to blocks/hero_glitch.schema.json diff --git a/blocks/navbar_terminal.ninjatpl b/blocks/navbar_terminal.ninjatpl new file mode 100644 index 0000000..edda2c2 --- /dev/null +++ b/blocks/navbar_terminal.ninjatpl @@ -0,0 +1 @@ + diff --git a/schemas/navbar_terminal.schema.json b/blocks/navbar_terminal.schema.json similarity index 100% rename from schemas/navbar_terminal.schema.json rename to blocks/navbar_terminal.schema.json diff --git a/blocks/stats_glow.ninjatpl b/blocks/stats_glow.ninjatpl new file mode 100644 index 0000000..046faa0 --- /dev/null +++ b/blocks/stats_glow.ninjatpl @@ -0,0 +1 @@ +
{% if items %}
{% for stat in items %}
{{ stat.value }}{% if stat.suffix %} {{ stat.suffix }}{% endif %}
{{ stat.label }}
{% endfor %}
{% else %}
// add items to render stats
{% endif %}
diff --git a/schemas/stats_glow.schema.json b/blocks/stats_glow.schema.json similarity index 100% rename from schemas/stats_glow.schema.json rename to blocks/stats_glow.schema.json diff --git a/button_override.go b/button_override.go deleted file mode 100644 index f3e4882..0000000 --- a/button_override.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "bytes" - "context" -) - -// CyberpunkButtonBlock renders the built-in button with cyberpunk styling: -// terminal-cursor caret suffix, RGB-split hover via the .rgb-split class, -// mono label and uppercase tracking. -func CyberpunkButtonBlock(ctx context.Context, content map[string]any) string { - label := getStringWithDefault(content, "label", "Button") - href := safeHref(getString(content, "href")) - variant := getStringWithDefault(content, "variant", "primary") - var buf bytes.Buffer - _ = cyberpunkButtonComponent(label, href, variant).Render(ctx, &buf) - return buf.String() -} diff --git a/button_override.templ b/button_override.templ deleted file mode 100644 index 9ac6e21..0000000 --- a/button_override.templ +++ /dev/null @@ -1,36 +0,0 @@ -package main - -// cyberpunkButtonComponent renders the override for the built-in button block. -// Primary buttons get .rgb-split for the chromatic-aberration hover. -// Secondary / ghost variants use the accent/border tokens. -templ cyberpunkButtonComponent(label, href, variant string) { - switch variant { - case "secondary": - - { label } - - - case "ghost": - - { label } - - - default: - - { label } - - - } -} diff --git a/button_override_templ.go b/button_override_templ.go deleted file mode 100644 index 9a92177..0000000 --- a/button_override_templ.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -// cyberpunkButtonComponent renders the override for the built-in button block. -// Primary buttons get .rgb-split for the chromatic-aberration hover. -// Secondary / ghost variants use the accent/border tokens. -func cyberpunkButtonComponent(label, href, variant string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - switch variant { - case "secondary": - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(label) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `button_override.templ`, Line: 14, Col: 17} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, " _") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - case "ghost": - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(label) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `button_override.templ`, Line: 23, Col: 17} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, " _") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - default: - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(label) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `button_override.templ`, Line: 32, Col: 17} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, " _") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/card_override.go b/card_override.go deleted file mode 100644 index e9cb9ed..0000000 --- a/card_override.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "bytes" - "context" -) - -// CyberpunkCardBlock renders the built-in card with a dashed neon border-image -// and hover-lift / chromatic-aberration shadow. -func CyberpunkCardBlock(ctx context.Context, content map[string]any) string { - title := getString(content, "title") - body := getString(content, "body") - href := getString(content, "href") - media := getString(content, "media") - var buf bytes.Buffer - _ = cyberpunkCardComponent(title, body, href, media).Render(ctx, &buf) - return buf.String() -} diff --git a/card_override.templ b/card_override.templ deleted file mode 100644 index b8e66e9..0000000 --- a/card_override.templ +++ /dev/null @@ -1,44 +0,0 @@ -package main - -// cyberpunkCardComponent renders the override for the built-in card block: -// dashed neon border, hover-lift with chromatic-aberration shadow. -templ cyberpunkCardComponent(title, body, href, media string) { - if href != "" { - - @cyberpunkCardInner(title, body, media) - - } else { -
- @cyberpunkCardInner(title, body, media) -
- } -} - -// cyberpunkCardInner renders the shared card body markup. -templ cyberpunkCardInner(title, body, media string) { - if media != "" { - - } - if title != "" { -

- { title } -

- } - if body != "" { -
- @templ.Raw(body) -
- } -} diff --git a/card_override_templ.go b/card_override_templ.go deleted file mode 100644 index 058fe1f..0000000 --- a/card_override_templ.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -// cyberpunkCardComponent renders the override for the built-in card block: -// dashed neon border, hover-lift with chromatic-aberration shadow. -func cyberpunkCardComponent(title, body, href, media string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - if href != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = cyberpunkCardInner(title, body, media).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = cyberpunkCardInner(title, body, media).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - return nil - }) -} - -// cyberpunkCardInner renders the shared card body markup. -func cyberpunkCardInner(title, body, media string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - if media != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\"\" ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if title != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `card_override.templ`, Line: 36, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if body != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(body).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/code_neon.go b/code_neon.go deleted file mode 100644 index 8f8f5fa..0000000 --- a/code_neon.go +++ /dev/null @@ -1,39 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// CodeNeonMeta defines metadata for the cyberpunk:code_neon block. -var CodeNeonMeta = blocks.BlockMeta{ - Key: "code_neon", - Title: "Code Block", - Description: "Server-rendered code block with neon edge and optional copy button", - Category: blocks.CategoryContent, - Source: "cyberpunk", -} - -// CodeNeonData is the typed view of the code_neon content map. -type CodeNeonData struct { - Language string - Code string - Copy bool -} - -// CodeNeonBlock renders the code_neon block. -// -// Content shape: -// {language:"bash"|"go"|..., code, copy: bool|"on"|"off"} -func CodeNeonBlock(ctx context.Context, content map[string]any) string { - data := CodeNeonData{ - Language: getStringWithDefault(content, "language", "text"), - Code: getString(content, "code"), - Copy: getBool(content, "copy", true), - } - var buf bytes.Buffer - _ = codeNeonComponent(data).Render(ctx, &buf) - return buf.String() -} diff --git a/code_neon.templ b/code_neon.templ deleted file mode 100644 index da285a4..0000000 --- a/code_neon.templ +++ /dev/null @@ -1,25 +0,0 @@ -package main - -// codeNeonComponent renders the cyberpunk:code_neon block. -templ codeNeonComponent(data CodeNeonData) { -
-
- { data.Language } - if data.Copy { - - } -
-
{ data.Code }
-
-} diff --git a/code_neon_templ.go b/code_neon_templ.go deleted file mode 100644 index 9b4cb80..0000000 --- a/code_neon_templ.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -// codeNeonComponent renders the cyberpunk:code_neon block. -func codeNeonComponent(data CodeNeonData) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(data.Language) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `code_neon.templ`, Line: 11, Col: 24} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.Copy { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
")
-		if templ_7745c5c3_Err != nil {
-			return templ_7745c5c3_Err
-		}
-		var templ_7745c5c3_Var4 = []any{"language-" + data.Language}
-		templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var4...)
-		if templ_7745c5c3_Err != nil {
-			return templ_7745c5c3_Err
-		}
-		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "")
-		if templ_7745c5c3_Err != nil {
-			return templ_7745c5c3_Err
-		}
-		var templ_7745c5c3_Var6 string
-		templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(data.Code)
-		if templ_7745c5c3_Err != nil {
-			return templ.Error{Err: templ_7745c5c3_Err, FileName: `code_neon.templ`, Line: 23, Col: 284}
-		}
-		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
-		if templ_7745c5c3_Err != nil {
-			return templ_7745c5c3_Err
-		}
-		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/cta_terminal.go b/cta_terminal.go deleted file mode 100644 index ee52b34..0000000 --- a/cta_terminal.go +++ /dev/null @@ -1,41 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// CTATerminalMeta defines metadata for the cyberpunk:cta_terminal block. -var CTATerminalMeta = blocks.BlockMeta{ - Key: "cta_terminal", - Title: "Terminal CTA", - Description: "Faux $ prompt with blinking caret and copy button", - Category: blocks.CategoryLayout, - Source: "cyberpunk", -} - -// CTATerminalData is the typed view of the cta_terminal content map. -type CTATerminalData struct { - Prompt string - Button string - Href string - Copyable bool -} - -// CTATerminalBlock renders the cta_terminal block. -// -// Content shape: -// {prompt, button, href, copyable: bool|"true"|"false"} -func CTATerminalBlock(ctx context.Context, content map[string]any) string { - data := CTATerminalData{ - Prompt: getStringWithDefault(content, "prompt", "$ npm i your-thing"), - Button: getStringWithDefault(content, "button", "Copy"), - Href: getString(content, "href"), - Copyable: getBool(content, "copyable", true), - } - var buf bytes.Buffer - _ = ctaTerminalComponent(data).Render(ctx, &buf) - return buf.String() -} diff --git a/cta_terminal.templ b/cta_terminal.templ deleted file mode 100644 index bb8b74a..0000000 --- a/cta_terminal.templ +++ /dev/null @@ -1,37 +0,0 @@ -package main - -// ctaTerminalComponent renders the cyberpunk:cta_terminal block as a faux terminal prompt. -templ ctaTerminalComponent(data CTATerminalData) { -
-
-
-
- - - { data.Prompt } - - -
- if data.Button != "" { - - { data.Button } - - } -
-
-
-} diff --git a/cta_terminal_templ.go b/cta_terminal_templ.go deleted file mode 100644 index f3194f5..0000000 --- a/cta_terminal_templ.go +++ /dev/null @@ -1,113 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -// ctaTerminalComponent renders the cyberpunk:cta_terminal block as a faux terminal prompt. -func ctaTerminalComponent(data CTATerminalData) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
$ ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(data.Prompt) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `cta_terminal.templ`, Line: 18, Col: 19} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.Button != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(data.Button) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `cta_terminal.templ`, Line: 31, Col: 19} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/email_wrapper.templ b/email_wrapper.templ deleted file mode 100644 index b4f35ad..0000000 --- a/email_wrapper.templ +++ /dev/null @@ -1,102 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/templates" -) - -// CyberpunkEmailWrapper is the registered cyberpunk:email_wrapper. -// It produces a dark email with a mono preheader, magenta hairline divider, -// and a literal "[esc] unsubscribe" link per UAT §10. -// -// UAT §10 mandates `body { background:#0a0a12 }`. That literal hex lives in the -// - - - if emailCtx.PreviewText != "" { - - } else { - - } - - - - -
- - - - - - - - - - - - - - -
- - -} diff --git a/email_wrapper_templ.go b/email_wrapper_templ.go deleted file mode 100644 index 4d11dd4..0000000 --- a/email_wrapper_templ.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/templates" -) - -// CyberpunkEmailWrapper is the registered cyberpunk:email_wrapper. -// It produces a dark email with a mono preheader, magenta hairline divider, -// and a literal "[esc] unsubscribe" link per UAT §10. -// -// UAT §10 mandates `body { background:#0a0a12 }`. That literal hex lives in the -// ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if emailCtx.PreviewText != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "
$ from: ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(emailCtx.SiteSettings.SiteName) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `email_wrapper.templ`, Line: 49, Col: 45} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " — ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(emailCtx.PreviewText) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `email_wrapper.templ`, Line: 49, Col: 74} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "
$ from: ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(emailCtx.SiteSettings.SiteName) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `email_wrapper.templ`, Line: 53, Col: 45} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "
$ from: ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(emailCtx.SiteSettings.SiteName) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `email_wrapper.templ`, Line: 63, Col: 50} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if emailCtx.SiteSettings.LogoURL != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\"")") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(body).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "
 
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if emailCtx.SiteSettings.SiteURL != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var10 string - templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(emailCtx.SiteSettings.SiteURL) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `email_wrapper.templ`, Line: 83, Col: 43} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if emailCtx.UnsubscribeURL != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "

[esc] unsubscribe

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "

[esc] unsubscribe

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/embed.go b/embed.go deleted file mode 100644 index 83bd65c..0000000 --- a/embed.go +++ /dev/null @@ -1,60 +0,0 @@ -package main - -import ( - "embed" - "io/fs" - "net/http" - - "git.dev.alexdunmow.com/block/core/plugin" -) - -//go:embed assets/* -var assetsFS embed.FS - -//go:embed schemas/* -var schemasFS embed.FS - -//go:embed presets.json -var presetsData []byte - -//go:embed fonts.json -var fontsData []byte - -//go:embed plugin.mod -var pluginModBytes []byte - -// Assets returns the embedded assets filesystem (rooted at "assets/"). -func Assets() fs.FS { - sub, _ := fs.Sub(assetsFS, "assets") - return sub -} - -// Schemas returns the embedded schemas filesystem (rooted at "schemas/"). -func Schemas() fs.FS { - sub, _ := fs.Sub(schemasFS, "schemas") - return sub -} - -// AssetsHandler returns an http.Handler that serves the embedded assets at /templates/cyberpunk/... -func AssetsHandler() http.Handler { - return http.FileServer(http.FS(Assets())) -} - -// ThemePresets returns the embedded theme presets JSON. -func ThemePresets() []byte { return presetsData } - -// BundledFonts returns the embedded fonts manifest JSON. -func BundledFonts() []byte { return fontsData } - -// ThemeCSSManifest exposes the theme's custom CSS (scanlines, glitch, neon-edge, -// caret-blink keyframes, font-family fallbacks) to the host Tailwind input so the -// utilities survive prod purging. -func ThemeCSSManifest() *plugin.CSSManifest { - css, err := assetsFS.ReadFile("assets/css/cyberpunk.css") - if err != nil { - return &plugin.CSSManifest{} - } - return &plugin.CSSManifest{ - InputCSSAppend: string(css), - } -} diff --git a/feature_card_neon.go b/feature_card_neon.go deleted file mode 100644 index d87f65c..0000000 --- a/feature_card_neon.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// FeatureCardNeonMeta defines metadata for the cyberpunk:feature_card_neon block. -var FeatureCardNeonMeta = blocks.BlockMeta{ - Key: "feature_card_neon", - Title: "Neon Feature Card", - Description: "Single feature card with per-card neon edge glow (magenta/cyan/lime)", - Category: blocks.CategoryLayout, - Source: "cyberpunk", -} - -// FeatureCardNeonData is the typed view of the feature_card_neon content map. -type FeatureCardNeonData struct { - Icon string - Title string - Body string - Accent string -} - -// FeatureCardNeonBlock renders the feature_card_neon block. -// -// Content shape: -// {icon, title, body, accent:"magenta"|"cyan"|"lime"} -func FeatureCardNeonBlock(ctx context.Context, content map[string]any) string { - data := FeatureCardNeonData{ - Icon: getString(content, "icon"), - Title: getStringWithDefault(content, "title", "Feature"), - Body: getString(content, "body"), - Accent: parseAccent(getString(content, "accent")), - } - var buf bytes.Buffer - _ = featureCardNeonComponent(data).Render(ctx, &buf) - return buf.String() -} - -// parseAccent normalises the accent value to one of the three known accents. -func parseAccent(v string) string { - switch v { - case "magenta", "cyan", "lime": - return v - default: - return "magenta" - } -} diff --git a/feature_card_neon.templ b/feature_card_neon.templ deleted file mode 100644 index 3c7bdc2..0000000 --- a/feature_card_neon.templ +++ /dev/null @@ -1,37 +0,0 @@ -package main - -// neonEdgeClass returns the per-accent neon-edge utility class. -func neonEdgeClass(accent string) string { - switch accent { - case "cyan": - return "neon-edge-cyan" - case "lime": - return "neon-edge-lime" - default: - return "neon-edge-magenta" - } -} - -// featureCardNeonComponent renders the cyberpunk:feature_card_neon block. -templ featureCardNeonComponent(data FeatureCardNeonData) { -
- if data.Icon != "" { -
- -
- } -

- { data.Title } -

- if data.Body != "" { -
- @templ.Raw(data.Body) -
- } -
-} diff --git a/feature_card_neon_templ.go b/feature_card_neon_templ.go deleted file mode 100644 index 2bfe129..0000000 --- a/feature_card_neon_templ.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -// neonEdgeClass returns the per-accent neon-edge utility class. -func neonEdgeClass(accent string) string { - switch accent { - case "cyan": - return "neon-edge-cyan" - case "lime": - return "neon-edge-lime" - default: - return "neon-edge-magenta" - } -} - -// featureCardNeonComponent renders the cyberpunk:feature_card_neon block. -func featureCardNeonComponent(data FeatureCardNeonData) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - var templ_7745c5c3_Var2 = []any{"cyberpunk-feature-card p-6 rounded-lg h-full flex flex-col gap-4", neonEdgeClass(data.Accent)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.Icon != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "
\"\"
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(data.Title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `feature_card_neon.templ`, Line: 29, Col: 15} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.Body != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Body).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/footer_grid.go b/footer_grid.go deleted file mode 100644 index f5c9ad9..0000000 --- a/footer_grid.go +++ /dev/null @@ -1,62 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// FooterGridMeta defines metadata for the cyberpunk:footer_grid block. -var FooterGridMeta = blocks.BlockMeta{ - Key: "footer_grid", - Title: "Grid Footer", - Description: "Mono columns, build-hash + uptime status pill", - Category: blocks.CategoryNavigation, - Source: "cyberpunk", -} - -// FooterColumn is one column of footer links. -type FooterColumn struct { - Title string - Links []Link -} - -// FooterGridData is the typed view of the footer_grid content map. -type FooterGridData struct { - ShowStatus bool - BuildHash string - Columns []FooterColumn -} - -// FooterGridBlock renders the footer_grid block. -// -// Content shape: -// {showStatus, buildHash, columns:[{title, links:[{label, href}]}]} -func FooterGridBlock(ctx context.Context, content map[string]any) string { - cols := getSlice(content, "columns") - columns := make([]FooterColumn, 0, len(cols)) - for _, col := range cols { - linkObjs := getSlice(col, "links") - links := make([]Link, 0, len(linkObjs)) - for _, l := range linkObjs { - links = append(links, Link{ - Label: getString(l, "label"), - Href: getString(l, "href"), - }) - } - columns = append(columns, FooterColumn{ - Title: getString(col, "title"), - Links: links, - }) - } - - data := FooterGridData{ - ShowStatus: getBool(content, "showStatus", true), - BuildHash: getStringWithDefault(content, "buildHash", "dev"), - Columns: columns, - } - var buf bytes.Buffer - _ = footerGridComponent(data).Render(ctx, &buf) - return buf.String() -} diff --git a/footer_grid.templ b/footer_grid.templ deleted file mode 100644 index 90ee825..0000000 --- a/footer_grid.templ +++ /dev/null @@ -1,77 +0,0 @@ -package main - -// footerGridColumns returns a tailwind grid-column class for n columns. -func footerGridColumns(n int) string { - switch n { - case 0, 1: - return "grid-cols-1" - case 2: - return "grid-cols-1 sm:grid-cols-2" - case 3: - return "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3" - default: - return "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4" - } -} - -// footerGridComponent renders the cyberpunk:footer_grid block. -templ footerGridComponent(data FooterGridData) { - -} diff --git a/footer_grid_templ.go b/footer_grid_templ.go deleted file mode 100644 index 26055bc..0000000 --- a/footer_grid_templ.go +++ /dev/null @@ -1,199 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -// footerGridColumns returns a tailwind grid-column class for n columns. -func footerGridColumns(n int) string { - switch n { - case 0, 1: - return "grid-cols-1" - case 2: - return "grid-cols-1 sm:grid-cols-2" - case 3: - return "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3" - default: - return "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4" - } -} - -// footerGridComponent renders the cyberpunk:footer_grid block. -func footerGridComponent(data FooterGridData) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/go.mod b/go.mod deleted file mode 100644 index 6e3a017..0000000 --- a/go.mod +++ /dev/null @@ -1,20 +0,0 @@ -module git.dev.alexdunmow.com/block/themes/cyberpunk - -go 1.26.4 - -require ( - git.dev.alexdunmow.com/block/core v0.15.2 - github.com/a-h/templ v0.3.1020 -) - -require ( - connectrpc.com/connect v1.20.0 // indirect - github.com/BurntSushi/toml v1.6.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect - github.com/jackc/pgx/v5 v5.9.2 // indirect - golang.org/x/mod v0.34.0 // indirect - golang.org/x/text v0.36.0 // indirect - google.golang.org/protobuf v1.36.11 // indirect -) diff --git a/go.sum b/go.sum deleted file mode 100644 index ebd3d11..0000000 --- a/go.sum +++ /dev/null @@ -1,46 +0,0 @@ -connectrpc.com/connect v1.20.0 h1:6TNDAB+WeNd2uolWNlYczB5E0KNNaVMNUEx8JEUsPmQ= -connectrpc.com/connect v1.20.0/go.mod h1:A2ygJrukXwWy32vkCAAHNVguZrqZ+jeZ9rGRnGR4dN4= -git.dev.alexdunmow.com/block/core v0.15.2 h1:qTjJxa1pClxwehkdTxXiJDpHQLr5DoXBUCa40QRO0L8= -git.dev.alexdunmow.com/block/core v0.15.2/go.mod h1:A+mgA9oeWoPhXruv4Mjpywwl2A9B5I3cKzlJjalBdlE= -github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= -github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= -github.com/a-h/templ v0.3.1020 h1:ypAT/L5ySWEnZ6Zft/5yfoWXYYkhFNvEFOeeqecg4tw= -github.com/a-h/templ v0.3.1020/go.mod h1:A2DlK61v+K+NRoGnhmYbNYVmtYHcFO5/AisMvBdDxTM= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= -github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.9.2 h1:3ZhOzMWnR4yJ+RW1XImIPsD1aNSz4T4fyP7zlQb56hw= -github.com/jackc/pgx/v5 v5.9.2/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4= -github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= -github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= -github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/tetratelabs/wazero v1.12.0 h1:DuWcpNu/FzgEXgGBDp8J1Spc+CWOvvtvVyjKlaZopYU= -github.com/tetratelabs/wazero v1.12.0/go.mod h1:LvKtzl2RqO4gyF27BiXU+nKAjcV8f38U+kP/q2vgxh0= -golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= -golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= -golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= -golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= -google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= -google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/heading_override.go b/heading_override.go deleted file mode 100644 index 7427940..0000000 --- a/heading_override.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "bytes" - "context" -) - -// CyberpunkHeadingBlock renders the built-in heading block with cyberpunk styling. -// H1/H2 get the glitch text-shadow (magenta + cyan offsets); smaller levels get -// mono small-caps eyebrow class. -func CyberpunkHeadingBlock(ctx context.Context, content map[string]any) string { - text := getString(content, "text") - textClass := getString(content, "textClass") - level := parseHeadingLevel(content) - var buf bytes.Buffer - _ = cyberpunkHeadingComponent(level, text, textClass).Render(ctx, &buf) - return buf.String() -} diff --git a/heading_override.templ b/heading_override.templ deleted file mode 100644 index 2eb59a0..0000000 --- a/heading_override.templ +++ /dev/null @@ -1,81 +0,0 @@ -package main - -// cyberpunkHeadingBaseClass returns default Tailwind classes for each heading level. -func cyberpunkHeadingBaseClass(level int) string { - switch level { - case 1: - return "text-4xl md:text-5xl font-bold tracking-tight" - case 2: - return "text-3xl md:text-4xl font-semibold tracking-tight" - case 3: - return "text-2xl font-semibold" - case 4: - return "text-xl font-semibold" - case 5: - return "text-lg font-medium" - case 6: - return "text-base font-medium" - default: - return "text-3xl font-semibold tracking-tight" - } -} - -// cyberpunkHeadingComponent renders the override for the built-in heading block. -// H1 and H2 get the .glitch class which gives them the RGB-split text-shadow. -// H3-H6 get the mono small-caps eyebrow class. -templ cyberpunkHeadingComponent(level int, text, textClass string) { - switch level { - case 1: -

- { text } -

- case 2: -

- { text } -

- case 3: -

- { text } -

- case 4: -

- { text } -

- case 5: -
- { text } -
- case 6: -
- { text } -
- default: -

- { text } -

- } -} diff --git a/heading_override_templ.go b/heading_override_templ.go deleted file mode 100644 index 30e9566..0000000 --- a/heading_override_templ.go +++ /dev/null @@ -1,352 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -// cyberpunkHeadingBaseClass returns default Tailwind classes for each heading level. -func cyberpunkHeadingBaseClass(level int) string { - switch level { - case 1: - return "text-4xl md:text-5xl font-bold tracking-tight" - case 2: - return "text-3xl md:text-4xl font-semibold tracking-tight" - case 3: - return "text-2xl font-semibold" - case 4: - return "text-xl font-semibold" - case 5: - return "text-lg font-medium" - case 6: - return "text-base font-medium" - default: - return "text-3xl font-semibold tracking-tight" - } -} - -// cyberpunkHeadingComponent renders the override for the built-in heading block. -// H1 and H2 get the .glitch class which gives them the RGB-split text-shadow. -// H3-H6 get the mono small-caps eyebrow class. -func cyberpunkHeadingComponent(level int, text, textClass string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - switch level { - case 1: - var templ_7745c5c3_Var2 = []any{"cyberpunk-display glitch", cyberpunkHeadingBaseClass(1), textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 34, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - case 2: - var templ_7745c5c3_Var6 = []any{"cyberpunk-display glitch", cyberpunkHeadingBaseClass(2), textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var9 string - templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 42, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - case 3: - var templ_7745c5c3_Var10 = []any{"cyberpunk-display", cyberpunkHeadingBaseClass(3), textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var12 string - templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 49, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - case 4: - var templ_7745c5c3_Var13 = []any{"cyberpunk-eyebrow cyberpunk-mono uppercase tracking-widest", cyberpunkHeadingBaseClass(4), textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var13...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var15 string - templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 56, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - case 5: - var templ_7745c5c3_Var16 = []any{"cyberpunk-eyebrow cyberpunk-mono uppercase tracking-widest", cyberpunkHeadingBaseClass(5), textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var16...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var18 string - templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 63, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - case 6: - var templ_7745c5c3_Var19 = []any{"cyberpunk-eyebrow cyberpunk-mono uppercase tracking-widest", cyberpunkHeadingBaseClass(6), textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var19...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var21 string - templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 70, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - default: - var templ_7745c5c3_Var22 = []any{"cyberpunk-display glitch", cyberpunkHeadingBaseClass(2), textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var22...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var25 string - templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 78, Col: 10} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/helpers.go b/helpers.go deleted file mode 100644 index a8c63ae..0000000 --- a/helpers.go +++ /dev/null @@ -1,102 +0,0 @@ -package main - -import "strconv" - -// getString extracts a string value from a content map. Returns "" on miss/wrong-type. -func getString(content map[string]any, key string) string { - if v, ok := content[key].(string); ok { - return v - } - return "" -} - -// getStringWithDefault is like getString but returns dflt if the key is missing or non-string. -func getStringWithDefault(content map[string]any, key, dflt string) string { - if v, ok := content[key].(string); ok && v != "" { - return v - } - return dflt -} - -// getBool extracts a boolean value from a content map. Accepts bool, "true"/"false", -// "on"/"off", "yes"/"no", and numerics. Returns dflt when missing or unparsable. -func getBool(content map[string]any, key string, dflt bool) bool { - switch v := content[key].(type) { - case bool: - return v - case string: - switch v { - case "true", "on", "yes", "1": - return true - case "false", "off", "no", "0", "": - return false - } - case float64: - return v != 0 - case int: - return v != 0 - } - return dflt -} - -// getSlice extracts a slice of object-shaped entries from a content map. -func getSlice(content map[string]any, key string) []map[string]any { - v, ok := content[key].([]any) - if !ok { - return nil - } - out := make([]map[string]any, 0, len(v)) - for _, item := range v { - if m, ok := item.(map[string]any); ok { - out = append(out, m) - } - } - return out -} - -// getLink reads a {label, href} link object. Tolerates string values -// (interpreted as href, label = href) and missing keys. -func getLink(content map[string]any, key string) Link { - v := content[key] - switch x := v.(type) { - case map[string]any: - return Link{Label: getString(x, "label"), Href: getString(x, "href")} - case string: - return Link{Label: x, Href: x} - } - return Link{} -} - -// Link is a {label, href} pair used by hero / nav / footer blocks. -type Link struct { - Label string - Href string -} - -// safeHref returns "#" when href is empty so templ.SafeURL never receives "". -func safeHref(href string) string { - if href == "" { - return "#" - } - return href -} - -// parseHeadingLevel parses a 1..6 heading level. Defaults to 2 for safety. -func parseHeadingLevel(content map[string]any) int { - switch v := content["level"].(type) { - case float64: - l := int(v) - if l >= 1 && l <= 6 { - return l - } - case int: - if v >= 1 && v <= 6 { - return v - } - case string: - if l, err := strconv.Atoi(v); err == nil && l >= 1 && l <= 6 { - return l - } - } - return 2 -} diff --git a/hero_glitch.go b/hero_glitch.go deleted file mode 100644 index e6df8c2..0000000 --- a/hero_glitch.go +++ /dev/null @@ -1,55 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// HeroGlitchMeta defines metadata for the cyberpunk glitch hero block. -var HeroGlitchMeta = blocks.BlockMeta{ - Key: "hero_glitch", - Title: "Glitch Hero", - Description: "RGB-split H1, neon CTA, optional scanline overlay toggle", - Category: blocks.CategoryLayout, - Source: "cyberpunk", -} - -// HeroGlitchData is the typed view of the hero_glitch content map. -type HeroGlitchData struct { - Eyebrow string - Headline string - Sub string - CTA Link - SecondaryCTA Link - Scanlines bool -} - -// HeroGlitchBlock renders the hero_glitch block. -// -// Content shape (matches schemas/hero_glitch.schema.json): -// {eyebrow, headline, sub, cta:{label,href}, secondaryCta:{label,href}, scanlines:"on"|"off"} -func HeroGlitchBlock(ctx context.Context, content map[string]any) string { - data := HeroGlitchData{ - Eyebrow: getString(content, "eyebrow"), - Headline: getStringWithDefault(content, "headline", "// hero headline"), - Sub: getString(content, "sub"), - CTA: getLink(content, "cta"), - SecondaryCTA: getLink(content, "secondaryCta"), - Scanlines: parseScanlines(content), - } - var buf bytes.Buffer - _ = heroGlitchComponent(data).Render(ctx, &buf) - return buf.String() -} - -func parseScanlines(content map[string]any) bool { - if v, ok := content["scanlines"].(string); ok { - return v == "on" || v == "true" - } - if v, ok := content["scanlines"].(bool); ok { - return v - } - return true -} diff --git a/hero_glitch.templ b/hero_glitch.templ deleted file mode 100644 index e8f6619..0000000 --- a/hero_glitch.templ +++ /dev/null @@ -1,54 +0,0 @@ -package main - -// heroGlitchComponent renders the cyberpunk:hero_glitch block with an RGB-split H1. -templ heroGlitchComponent(data HeroGlitchData) { -
- if data.Scanlines { - - } -
- if data.Eyebrow != "" { -

- { data.Eyebrow } -

- } -

- { data.Headline } -

- if data.Sub != "" { -

- { data.Sub } -

- } -
- if data.CTA.Label != "" { - - { data.CTA.Label } - - - } - if data.SecondaryCTA.Label != "" { - - { data.SecondaryCTA.Label } - - } -
-
-
-} diff --git a/hero_glitch_templ.go b/hero_glitch_templ.go deleted file mode 100644 index 22bc4f3..0000000 --- a/hero_glitch_templ.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -// heroGlitchComponent renders the cyberpunk:hero_glitch block with an RGB-split H1. -func heroGlitchComponent(data HeroGlitchData) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.Scanlines { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.Eyebrow != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(data.Eyebrow) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `hero_glitch.templ`, Line: 16, Col: 19} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(data.Headline) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `hero_glitch.templ`, Line: 24, Col: 19} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.Sub != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(data.Sub) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `hero_glitch.templ`, Line: 28, Col: 15} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.CTA.Label != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.CTA.Label) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `hero_glitch.templ`, Line: 38, Col: 28} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, " _ ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if data.SecondaryCTA.Label != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var9 string - templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(data.SecondaryCTA.Label) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `hero_glitch.templ`, Line: 48, Col: 37} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/main.go b/main.go deleted file mode 100644 index e854b20..0000000 --- a/main.go +++ /dev/null @@ -1,17 +0,0 @@ -//go:build wasip1 - -// Package main compiles the cyberpunk theme to a wasip1 reactor-mode wasm guest -// (WO-WZ-015). The .so build path is retired; `ninja plugin build` produces the -// .bnp artifact the registry serves. -// -// Reactor mode: the host runs `_initialize` once per pooled instance, which -// runs this init func (hence wasmguest.Serve) before any bn_invoke. Serve is -// non-blocking; all theme work then arrives over the ABI hook calls. main is -// never called. -package main - -import "git.dev.alexdunmow.com/block/core/plugin/wasmguest" - -func init() { wasmguest.Serve(Registration) } - -func main() {} // never called — reactor mode diff --git a/manifest.yaml b/manifest.yaml new file mode 100644 index 0000000..2f01fd7 --- /dev/null +++ b/manifest.yaml @@ -0,0 +1,277 @@ +# Cyberpunk theme — codeless .bnp manifest (WO-WZ-021 Phase B). +# Synthesized into manifest.pb by `ninja plugin build` (no plugin.wasm). +theme_presets: presets.json +bundled_fonts: fonts.json +master_pages: master_pages.json + +system_templates: + - key: cyberpunk + title: Cyberpunk + description: "Neon-on-black BlockNinja theme with glitch motifs, monospace accents, and magenta/cyan/lime tri-accent palette for SaaS, dev tools, and crypto." + +page_templates: + - system: cyberpunk + key: default + title: Default + description: "Standard dark page with scanline overlay, sticky terminal-style header" + slots: [header, main, footer] + - system: cyberpunk + key: landing + title: Landing + description: "Hero with glitch H1, neon CTA, feature grid, social proof, footer" + slots: [hero, features, cta, footer] + - system: cyberpunk + key: article + title: Article + description: "Mono-metadata header, prose column, code-friendly aside" + slots: [header, main, aside, footer] + - system: cyberpunk + key: full-width + title: Full Width + description: "Edge-to-edge dashboard / showcase layout, no max-width" + slots: [header, main, footer] + +template_overrides: + - { template: cyberpunk, block: heading } + - { template: cyberpunk, block: text } + - { template: cyberpunk, block: button } + - { template: cyberpunk, block: card } + +email_wrappers: + - cyberpunk + +css: + input_css_append: | + /* ============================================================ + Cyberpunk — Neon-on-black BlockNinja theme + Scanlines / glitch / RGB-split / caret-blink / neon-edge utilities. + All colours consume the host shadcn HSL tokens via hsl(var(--token)). + No hardcoded hex / rgb / named colours. + ============================================================ */ + + /* --- Typography fallbacks --------------------------------- */ + + .cyberpunk-body { + font-family: var(--font-body, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif); + } + + .cyberpunk-mono, + .cyberpunk-mono *, + .cyberpunk-mono code, + pre.cyberpunk-mono, + code.cyberpunk-mono { + font-family: var(--font-mono, "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace); + } + + .cyberpunk-display { + font-family: var(--font-heading, "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif); + letter-spacing: -0.01em; + } + + .cyberpunk-prose, + .cyberpunk-prose p, + .cyberpunk-prose li { + font-family: var(--font-body, "Inter", system-ui, sans-serif); + line-height: 1.75; + } + + .cyberpunk-prose code { + color: hsl(var(--accent)); + background-color: hsl(var(--muted)); + padding: 0.125rem 0.375rem; + border-radius: 0.25rem; + font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace); + font-size: 0.875em; + } + + /* --- Scanlines -------------------------------------------- */ + + .scanlines { + opacity: 0.04; + background-image: linear-gradient( + to bottom, + hsl(var(--foreground)) 0px, + hsl(var(--foreground)) 1px, + transparent 1px, + transparent 3px + ); + background-size: 100% 3px; + animation: scanline-drift 6s linear infinite; + } + + @keyframes scanline-drift { + 0% { background-position: 0 0; } + 100% { background-position: 0 3px; } + } + + /* --- Glitch (RGB-split text-shadow) on H1/H2 -------------- */ + + .glitch { + position: relative; + text-shadow: + -2px 0 hsl(var(--primary)), + 2px 0 hsl(var(--accent)); + animation: glitch-x 3.6s steps(1, end) infinite; + } + + @keyframes glitch-x { + 0%, 92%, 100% { + text-shadow: + -2px 0 hsl(var(--primary)), + 2px 0 hsl(var(--accent)); + } + 93% { + text-shadow: + -3px 0 hsl(var(--primary)), + 3px 0 hsl(var(--accent)), + 0 1px hsl(var(--accent)); + } + 95% { + text-shadow: + -1px 0 hsl(var(--accent)), + 4px 0 hsl(var(--primary)); + } + 97% { + text-shadow: + -2px 0 hsl(var(--primary)), + 2px 0 hsl(var(--accent)); + } + } + + /* --- RGB-split hover/focus/active on primary buttons ------ */ + + .rgb-split { + transition: transform 120ms ease, box-shadow 120ms ease; + } + + .rgb-split:hover, + .rgb-split:focus-visible { + box-shadow: + -2px 0 0 hsl(var(--primary)), + 2px 0 0 hsl(var(--accent)); + transform: translateY(-1px); + } + + /* Touch tap-flash fallback (iOS strips :hover after touchend) */ + .cyberpunk-btn:active, + .rgb-split:active, + button.cyberpunk-btn:active { + box-shadow: + -2px 0 0 hsl(var(--primary)), + 2px 0 0 hsl(var(--accent)); + } + + /* :focus-visible ring uses the ring token, not browser default */ + .cyberpunk-btn:focus-visible, + .cyberpunk-btn-ghost:focus-visible, + button:focus-visible, + a:focus-visible { + outline: 2px solid hsl(var(--ring)); + outline-offset: 2px; + } + + /* --- Caret blink ------------------------------------------ */ + + .caret-blink { + display: inline-block; + animation: caret 1.05s steps(2, end) infinite; + } + + @keyframes caret { + 0%, 50% { opacity: 1; } + 51%, 100% { opacity: 0; } + } + + /* --- Neon edge utilities (magenta / cyan / lime) ---------- */ + + .neon-edge-magenta { + box-shadow: + 0 0 0 1px hsl(var(--primary) / 0.4), + 0 0 18px hsl(var(--primary) / 0.25); + transition: box-shadow 180ms ease, transform 180ms ease; + } + .neon-edge-magenta:hover, + .neon-edge-magenta:focus-within { + box-shadow: + 0 0 0 1px hsl(var(--primary) / 0.85), + 0 0 28px hsl(var(--primary) / 0.45); + transform: translateY(-1px); + } + + .neon-edge-cyan { + box-shadow: + 0 0 0 1px hsl(var(--accent) / 0.4), + 0 0 18px hsl(var(--accent) / 0.25); + transition: box-shadow 180ms ease, transform 180ms ease; + } + .neon-edge-cyan:hover, + .neon-edge-cyan:focus-within { + box-shadow: + 0 0 0 1px hsl(var(--accent) / 0.85), + 0 0 28px hsl(var(--accent) / 0.45); + transform: translateY(-1px); + } + + .neon-edge-lime { + /* Lime accent is the toxic-bloom primary; magenta-noir uses the primary + token. We reuse --ring as a third neon channel so this utility renders + visibly across all three presets. */ + box-shadow: + 0 0 0 1px hsl(var(--ring) / 0.4), + 0 0 18px hsl(var(--ring) / 0.25); + transition: box-shadow 180ms ease, transform 180ms ease; + } + .neon-edge-lime:hover, + .neon-edge-lime:focus-within { + box-shadow: + 0 0 0 1px hsl(var(--ring) / 0.85), + 0 0 28px hsl(var(--ring) / 0.45); + transform: translateY(-1px); + } + + /* --- Card override dashed border --------------------------- */ + + .cyberpunk-card { + position: relative; + } + + /* --- Status pill / dot animation -------------------------- */ + + .cyberpunk-status-dot { + animation: cyberpunk-pulse 2.2s ease-in-out infinite; + } + + @keyframes cyberpunk-pulse { + 0%, 100% { opacity: 1; } + 50% { opacity: 0.4; } + } + + /* --- Reduced motion: disable glitch, caret, scanline ------ */ + + @media (prefers-reduced-motion: reduce) { + .glitch, + .caret-blink, + .scanlines, + .cyberpunk-status-dot { + animation: none !important; + animation-duration: 0.01ms !important; + } + .glitch { + text-shadow: none; + } + .scanlines { + opacity: 0; + } + .rgb-split:hover, + .rgb-split:focus-visible { + transform: none; + } + } + + /* --- High-contrast: kill scanlines ------------------------ */ + + @media (prefers-contrast: more) { + .scanlines { + display: none; + } + } diff --git a/master_pages.json b/master_pages.json new file mode 100644 index 0000000..ea7776b --- /dev/null +++ b/master_pages.json @@ -0,0 +1,33 @@ +[ + { + "key": "cyberpunk:default-master", + "title": "Cyberpunk Default Master", + "page_templates": ["default", "article"], + "blocks": [ + { "block_key": "cyberpunk:navbar_terminal", "title": "Top Nav", "content": { "menuName": "main", "commandPrefix": "~/" }, "slot": "header", "sort_order": 0 }, + { "block_key": "slot", "title": "Main Slot", "content": { "slotName": "main", "placeholder": "// content" }, "slot": "main", "sort_order": 0 }, + { "block_key": "cyberpunk:footer_grid", "title": "Site Footer", "content": { "showStatus": true, "buildHash": "auto" }, "slot": "footer", "sort_order": 0 } + ] + }, + { + "key": "cyberpunk:landing-master", + "title": "Cyberpunk Landing Master", + "page_templates": ["landing"], + "blocks": [ + { "block_key": "cyberpunk:hero_glitch", "title": "Glitch Hero", "content": { "eyebrow": "NEW", "headline": "Ship like it's 2049", "cta": { "label": "Get the SDK", "href": "#" } }, "slot": "hero", "sort_order": 0 }, + { "block_key": "slot", "title": "Features Slot", "content": { "slotName": "features" }, "slot": "features", "sort_order": 0 }, + { "block_key": "cyberpunk:cta_terminal", "title": "CTA Strip", "content": { "prompt": "$ npm i your-thing", "button": "Copy" }, "slot": "cta", "sort_order": 0 }, + { "block_key": "cyberpunk:footer_grid", "title": "Site Footer", "content": { "showStatus": true }, "slot": "footer", "sort_order": 0 } + ] + }, + { + "key": "cyberpunk:full-master", + "title": "Cyberpunk Full Master", + "page_templates": ["full-width"], + "blocks": [ + { "block_key": "cyberpunk:navbar_terminal", "title": "Top Nav", "content": { "menuName": "main" }, "slot": "header", "sort_order": 0 }, + { "block_key": "slot", "title": "Main Slot", "content": { "slotName": "main" }, "slot": "main", "sort_order": 0 }, + { "block_key": "cyberpunk:footer_grid", "title": "Site Footer", "content": { "showStatus": false }, "slot": "footer", "sort_order": 0 } + ] + } +] diff --git a/navbar_terminal.go b/navbar_terminal.go deleted file mode 100644 index f14ecdb..0000000 --- a/navbar_terminal.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// NavbarTerminalMeta defines metadata for the cyberpunk:navbar_terminal block. -var NavbarTerminalMeta = blocks.BlockMeta{ - Key: "navbar_terminal", - Title: "Terminal Navbar", - Description: "Mono-spaced navbar with $ command prefix and optional status dot", - Category: blocks.CategoryNavigation, - Source: "cyberpunk", -} - -// NavbarTerminalData is the typed view of the navbar_terminal content map. -type NavbarTerminalData struct { - MenuName string - CommandPrefix string - StatusDot bool -} - -// NavbarTerminalBlock renders the navbar_terminal block. -// -// Content shape: -// {menuName, commandPrefix, statusDot:"on"|"off"|bool} -// -// menuName is the slug of a CMS-managed menu; the actual
    items are -// resolved by the host menu lookup. This block emits the chrome wrapper plus a -// data-menu-name hook the host renderer reads at runtime. -func NavbarTerminalBlock(ctx context.Context, content map[string]any) string { - data := NavbarTerminalData{ - MenuName: getStringWithDefault(content, "menuName", "main"), - CommandPrefix: getStringWithDefault(content, "commandPrefix", "~/"), - StatusDot: getBool(content, "statusDot", true), - } - var buf bytes.Buffer - _ = navbarTerminalComponent(data).Render(ctx, &buf) - return buf.String() -} diff --git a/navbar_terminal.templ b/navbar_terminal.templ deleted file mode 100644 index 1ad1b8c..0000000 --- a/navbar_terminal.templ +++ /dev/null @@ -1,50 +0,0 @@ -package main - -// navbarTerminalComponent renders the cyberpunk:navbar_terminal block. -// At ≤768px the link list collapses behind an aria-expanded toggle button. -templ navbarTerminalComponent(data NavbarTerminalData) { - -} diff --git a/navbar_terminal_templ.go b/navbar_terminal_templ.go deleted file mode 100644 index fa998d9..0000000 --- a/navbar_terminal_templ.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -// navbarTerminalComponent renders the cyberpunk:navbar_terminal block. -// At ≤768px the link list collapses behind an aria-expanded toggle button. -func navbarTerminalComponent(data NavbarTerminalData) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/plugin.mod b/plugin.mod index 5d197b3..a7dcebd 100644 --- a/plugin.mod +++ b/plugin.mod @@ -2,11 +2,8 @@ name = "cyberpunk" display_name = "Cyberpunk" scope = "@themes" -version = "0.1.2" +version = "0.2.0" description = "Neon-on-black BlockNinja theme with glitch motifs, monospace accents, and magenta/cyan/lime tri-accent palette for SaaS, dev tools, and crypto." kind = "theme" categories = ["templates"] tags = ["dark", "neon", "glitch", "monospace", "saas", "developer", "tech", "crypto", "fintech"] - -[compatibility] -block_core = ">=0.15.0 <0.16.0" diff --git a/register.go b/register.go deleted file mode 100644 index 7bebb84..0000000 --- a/register.go +++ /dev/null @@ -1,190 +0,0 @@ -package main - -import ( - "context" - - "github.com/a-h/templ" - - "git.dev.alexdunmow.com/block/core/blocks" - "git.dev.alexdunmow.com/block/core/plugin" - "git.dev.alexdunmow.com/block/core/templates" -) - -// wrap adapts a templ-returning render function to templates.TemplateFunc. -// templ.Component already implements templates.HTMLComponent via Render. -func wrap(f func(ctx context.Context, doc map[string]any) templ.Component) templates.TemplateFunc { - return func(ctx context.Context, doc map[string]any) templates.HTMLComponent { - return f(ctx, doc) - } -} - -// Register is the plugin entry point that registers the Cyberpunk system template, -// page templates, theme-owned blocks, built-in overrides, and the email wrapper. -func Register(tr templates.TemplateRegistry, br blocks.BlockRegistry) error { - // 1. System template metadata. - tr.RegisterSystemTemplate(templates.SystemTemplateMeta{ - Key: "cyberpunk", - Title: "Cyberpunk", - Description: "Neon-on-black BlockNinja theme with glitch motifs, monospace accents, and magenta/cyan/lime tri-accent palette for SaaS, dev tools, and crypto.", - }) - - // 2. Page templates — slot lists match docs/works/cyberpunk.md byte-for-byte. - if err := tr.RegisterPageTemplate("cyberpunk", templates.PageTemplateMeta{ - Key: "default", - Title: "Default", - Description: "Standard dark page with scanline overlay, sticky terminal-style header", - Slots: []string{"header", "main", "footer"}, - }, wrap(RenderCyberpunk)); err != nil { - return err - } - - if err := tr.RegisterPageTemplate("cyberpunk", templates.PageTemplateMeta{ - Key: "landing", - Title: "Landing", - Description: "Hero with glitch H1, neon CTA, feature grid, social proof, footer", - Slots: []string{"hero", "features", "cta", "footer"}, - }, wrap(RenderCyberpunkLanding)); err != nil { - return err - } - - if err := tr.RegisterPageTemplate("cyberpunk", templates.PageTemplateMeta{ - Key: "article", - Title: "Article", - Description: "Mono-metadata header, prose column, code-friendly aside", - Slots: []string{"header", "main", "aside", "footer"}, - }, wrap(RenderCyberpunkArticle)); err != nil { - return err - } - - if err := tr.RegisterPageTemplate("cyberpunk", templates.PageTemplateMeta{ - Key: "full-width", - Title: "Full Width", - Description: "Edge-to-edge dashboard / showcase layout, no max-width", - Slots: []string{"header", "main", "footer"}, - }, wrap(RenderCyberpunkFullWidth)); err != nil { - return err - } - - // 3. Load block schemas BEFORE registering any blocks. - if err := br.LoadSchemasFromFS(Schemas()); err != nil { - return err - } - - // 4. Theme-owned blocks (seven, per spec section "Blocks to build"). - br.Register(HeroGlitchMeta, HeroGlitchBlock) - br.Register(CTATerminalMeta, CTATerminalBlock) - br.Register(NavbarTerminalMeta, NavbarTerminalBlock) - br.Register(FooterGridMeta, FooterGridBlock) - br.Register(FeatureCardNeonMeta, FeatureCardNeonBlock) - br.Register(StatsGlowMeta, StatsGlowBlock) - br.Register(CodeNeonMeta, CodeNeonBlock) - - // 5. Built-in block overrides — applied only when this theme is active. - br.RegisterTemplateOverride("cyberpunk", "heading", CyberpunkHeadingBlock) - br.RegisterTemplateOverride("cyberpunk", "text", CyberpunkTextBlock) - br.RegisterTemplateOverride("cyberpunk", "button", CyberpunkButtonBlock) - br.RegisterTemplateOverride("cyberpunk", "card", CyberpunkCardBlock) - - // 6. Email wrapper. - tr.RegisterEmailWrapper("cyberpunk", CyberpunkEmailWrapper) - - return nil -} - -// DefaultMasterPages returns the three master pages Cyberpunk seeds on first load. -// Spec table — section "Master pages" — drives keys, blocks, slots and sort orders. -func DefaultMasterPages() []plugin.MasterPageDefinition { - return []plugin.MasterPageDefinition{ - { - Key: "cyberpunk:default-master", - Title: "Cyberpunk Default Master", - PageTemplates: []string{"default", "article"}, - Blocks: []plugin.MasterPageBlock{ - { - BlockKey: "cyberpunk:navbar_terminal", - Title: "Top Nav", - Content: map[string]any{"menuName": "main", "commandPrefix": "~/"}, - Slot: "header", - SortOrder: 0, - }, - { - BlockKey: "slot", - Title: "Main Slot", - Content: map[string]any{"slotName": "main", "placeholder": "// content"}, - Slot: "main", - SortOrder: 0, - }, - { - BlockKey: "cyberpunk:footer_grid", - Title: "Site Footer", - Content: map[string]any{"showStatus": true, "buildHash": "auto"}, - Slot: "footer", - SortOrder: 0, - }, - }, - }, - { - Key: "cyberpunk:landing-master", - Title: "Cyberpunk Landing Master", - PageTemplates: []string{"landing"}, - Blocks: []plugin.MasterPageBlock{ - { - BlockKey: "cyberpunk:hero_glitch", - Title: "Glitch Hero", - Content: map[string]any{"eyebrow": "NEW", "headline": "Ship like it's 2049", "cta": map[string]any{"label": "Get the SDK", "href": "#"}}, - Slot: "hero", - SortOrder: 0, - }, - { - BlockKey: "slot", - Title: "Features Slot", - Content: map[string]any{"slotName": "features"}, - Slot: "features", - SortOrder: 0, - }, - { - BlockKey: "cyberpunk:cta_terminal", - Title: "CTA Strip", - Content: map[string]any{"prompt": "$ npm i your-thing", "button": "Copy"}, - Slot: "cta", - SortOrder: 0, - }, - { - BlockKey: "cyberpunk:footer_grid", - Title: "Site Footer", - Content: map[string]any{"showStatus": true}, - Slot: "footer", - SortOrder: 0, - }, - }, - }, - { - Key: "cyberpunk:full-master", - Title: "Cyberpunk Full Master", - PageTemplates: []string{"full-width"}, - Blocks: []plugin.MasterPageBlock{ - { - BlockKey: "cyberpunk:navbar_terminal", - Title: "Top Nav", - Content: map[string]any{"menuName": "main"}, - Slot: "header", - SortOrder: 0, - }, - { - BlockKey: "slot", - Title: "Main Slot", - Content: map[string]any{"slotName": "main"}, - Slot: "main", - SortOrder: 0, - }, - { - BlockKey: "cyberpunk:footer_grid", - Title: "Site Footer", - Content: map[string]any{"showStatus": false}, - Slot: "footer", - SortOrder: 0, - }, - }, - }, - } -} diff --git a/registration.go b/registration.go deleted file mode 100644 index f1a6538..0000000 --- a/registration.go +++ /dev/null @@ -1,26 +0,0 @@ -package main - -import ( - "io/fs" - "net/http" - - "git.dev.alexdunmow.com/block/core/blocks" - "git.dev.alexdunmow.com/block/core/plugin" - "git.dev.alexdunmow.com/block/core/templates" -) - -// Registration is the compile-time plugin registration for the Cyberpunk theme. -var Registration = plugin.PluginRegistration{ - Name: "cyberpunk", - Version: plugin.ParseModVersion(pluginModBytes), - Register: func(tr templates.TemplateRegistry, br blocks.BlockRegistry) error { - return Register(tr, br) - }, - Assets: func() http.Handler { return AssetsHandler() }, - Schemas: func() fs.FS { return Schemas() }, - ThemePresets: func() []byte { return ThemePresets() }, - BundledFonts: func() []byte { return BundledFonts() }, - MasterPages: func() []plugin.MasterPageDefinition { return DefaultMasterPages() }, - CSSManifest: func() *plugin.CSSManifest { return ThemeCSSManifest() }, - RequiredIconPacks: plugin.ParseRequiredIconPacks(pluginModBytes), -} diff --git a/stats_glow.go b/stats_glow.go deleted file mode 100644 index bfc7ce6..0000000 --- a/stats_glow.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// StatsGlowMeta defines metadata for the cyberpunk:stats_glow block. -var StatsGlowMeta = blocks.BlockMeta{ - Key: "stats_glow", - Title: "Glow Stats", - Description: "Big mono numerals with neon accent underline", - Category: "display", - Source: "cyberpunk", -} - -// StatGlowItem is one stat in the grid. -type StatGlowItem struct { - Value string - Label string - Suffix string -} - -// StatsGlowBlock renders the stats_glow block. -// -// Content shape: -// {items:[{value, label, suffix}]} -func StatsGlowBlock(ctx context.Context, content map[string]any) string { - raw := getSlice(content, "items") - items := make([]StatGlowItem, 0, len(raw)) - for _, item := range raw { - items = append(items, StatGlowItem{ - Value: getString(item, "value"), - Label: getString(item, "label"), - Suffix: getString(item, "suffix"), - }) - } - var buf bytes.Buffer - _ = statsGlowComponent(items).Render(ctx, &buf) - return buf.String() -} diff --git a/stats_glow.templ b/stats_glow.templ deleted file mode 100644 index ee2b1fc..0000000 --- a/stats_glow.templ +++ /dev/null @@ -1,52 +0,0 @@ -package main - -// statsGridColumns returns the tailwind grid-column class for n stats. -func statsGridColumns(n int) string { - switch n { - case 0, 1: - return "grid-cols-1" - case 2: - return "grid-cols-1 sm:grid-cols-2" - case 3: - return "grid-cols-1 sm:grid-cols-3" - default: - return "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4" - } -} - -// statsGlowComponent renders the cyberpunk:stats_glow block. -templ statsGlowComponent(items []StatGlowItem) { -
    -
    - if len(items) == 0 { -
    - { "// add items to render stats" } -
    - } else { -
    - for _, stat := range items { -
    -
    - { stat.Value } - if stat.Suffix != "" { - { stat.Suffix } - } -
    -
    -
    - { stat.Label } -
    -
    - } -
    - } -
    -
    -} diff --git a/stats_glow_templ.go b/stats_glow_templ.go deleted file mode 100644 index 3cc8f60..0000000 --- a/stats_glow_templ.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -// statsGridColumns returns the tailwind grid-column class for n stats. -func statsGridColumns(n int) string { - switch n { - case 0, 1: - return "grid-cols-1" - case 2: - return "grid-cols-1 sm:grid-cols-2" - case 3: - return "grid-cols-1 sm:grid-cols-3" - default: - return "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4" - } -} - -// statsGlowComponent renders the cyberpunk:stats_glow block. -func statsGlowComponent(items []StatGlowItem) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if len(items) == 0 { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var2 string - templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs("// add items to render stats") - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `stats_glow.templ`, Line: 27, Col: 37} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - var templ_7745c5c3_Var3 = []any{"grid gap-8 text-center", statsGridColumns(len(items))} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var3...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - for _, stat := range items { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(stat.Value) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `stats_glow.templ`, Line: 37, Col: 26} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if stat.Suffix != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(stat.Suffix) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `stats_glow.templ`, Line: 39, Col: 64} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(stat.Label) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `stats_glow.templ`, Line: 44, Col: 20} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/template.templ b/template.templ deleted file mode 100644 index 45955f0..0000000 --- a/template.templ +++ /dev/null @@ -1,237 +0,0 @@ -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() -
    - @templ.Raw(data.Slots["header"]) -
    -
    - if main, ok := data.Slots["main"]; ok && main != "" { - @templ.Raw(main) - } else { -
    -

    No content blocks assigned to this page.

    -
    - } -
    -
    - @templ.Raw(data.Slots["footer"]) -
    - @bn.BodyEnd(data.SiteSettings) - - -} - -// CyberpunkLanding renders the marketing landing template with hero/features/cta/footer slots. -templ CyberpunkLanding(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() -
    - @templ.Raw(data.Slots["hero"]) -
    -
    - @templ.Raw(data.Slots["features"]) -
    -
    - @templ.Raw(data.Slots["cta"]) -
    -
    - @templ.Raw(data.Slots["footer"]) -
    - @bn.BodyEnd(data.SiteSettings) - - -} - -// CyberpunkArticle renders the article template with mono-metadata header and a code-friendly aside. -templ CyberpunkArticle(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() -
    -
    - @templ.Raw(data.Slots["header"]) -
    -
    -
    -
    - @templ.Raw(data.Slots["main"]) -
    - -
    -
    - @templ.Raw(data.Slots["footer"]) -
    - @bn.BodyEnd(data.SiteSettings) - - -} - -// CyberpunkFullWidth renders the edge-to-edge template (no max-width clamping on main). -templ CyberpunkFullWidth(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() -
    - @templ.Raw(data.Slots["header"]) -
    -
    - if main, ok := data.Slots["main"]; ok && main != "" { - @templ.Raw(main) - } else { -
    -

    No content blocks assigned to this page.

    -
    - } -
    -
    - @templ.Raw(data.Slots["footer"]) -
    - @bn.BodyEnd(data.SiteSettings) - - -} - -// RenderCyberpunk renders the default Cyberpunk page template. -func RenderCyberpunk(ctx context.Context, doc map[string]any) templ.Component { - return Cyberpunk(parseCyberpunkPageData(doc)) -} - -// RenderCyberpunkLanding renders the Cyberpunk landing page template. -func RenderCyberpunkLanding(ctx context.Context, doc map[string]any) templ.Component { - return CyberpunkLanding(parseCyberpunkPageData(doc)) -} - -// RenderCyberpunkArticle renders the Cyberpunk article page template. -func RenderCyberpunkArticle(ctx context.Context, doc map[string]any) templ.Component { - return CyberpunkArticle(parseCyberpunkPageData(doc)) -} - -// RenderCyberpunkFullWidth renders the Cyberpunk full-width page template. -func RenderCyberpunkFullWidth(ctx context.Context, doc map[string]any) templ.Component { - return CyberpunkFullWidth(parseCyberpunkPageData(doc)) -} diff --git a/template_templ.go b/template_templ.go deleted file mode 100644 index 83b1095..0000000 --- a/template_templ.go +++ /dev/null @@ -1,520 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -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). -func scanlineOverlay() templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// Cyberpunk renders the default page template. -func Cyberpunk(data PageData) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var2 := templ.GetChildren(ctx) - if templ_7745c5c3_Var2 == nil { - templ_7745c5c3_Var2 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = 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, - }).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = bn.AdminBypassBanner(data.SiteSettings).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = scanlineOverlay().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Slots["header"]).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if main, ok := data.Slots["main"]; ok && main != "" { - templ_7745c5c3_Err = templ.Raw(main).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "

    No content blocks assigned to this page.

    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Slots["footer"]).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = bn.BodyEnd(data.SiteSettings).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// CyberpunkLanding renders the marketing landing template with hero/features/cta/footer slots. -func CyberpunkLanding(data PageData) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = 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, - }).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = bn.AdminBypassBanner(data.SiteSettings).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = scanlineOverlay().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Slots["hero"]).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Slots["features"]).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Slots["cta"]).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Slots["footer"]).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = bn.BodyEnd(data.SiteSettings).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// CyberpunkArticle renders the article template with mono-metadata header and a code-friendly aside. -func CyberpunkArticle(data PageData) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var4 := templ.GetChildren(ctx) - if templ_7745c5c3_Var4 == nil { - templ_7745c5c3_Var4 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = 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, - }).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = bn.AdminBypassBanner(data.SiteSettings).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = scanlineOverlay().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Slots["header"]).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Slots["main"]).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Slots["footer"]).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = bn.BodyEnd(data.SiteSettings).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// CyberpunkFullWidth renders the edge-to-edge template (no max-width clamping on main). -func CyberpunkFullWidth(data PageData) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = 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, - }).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = bn.AdminBypassBanner(data.SiteSettings).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = scanlineOverlay().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Slots["header"]).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if main, ok := data.Slots["main"]; ok && main != "" { - templ_7745c5c3_Err = templ.Raw(main).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "

    No content blocks assigned to this page.

    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(data.Slots["footer"]).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = bn.BodyEnd(data.SiteSettings).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// RenderCyberpunk renders the default Cyberpunk page template. -func RenderCyberpunk(ctx context.Context, doc map[string]any) templ.Component { - return Cyberpunk(parseCyberpunkPageData(doc)) -} - -// RenderCyberpunkLanding renders the Cyberpunk landing page template. -func RenderCyberpunkLanding(ctx context.Context, doc map[string]any) templ.Component { - return CyberpunkLanding(parseCyberpunkPageData(doc)) -} - -// RenderCyberpunkArticle renders the Cyberpunk article page template. -func RenderCyberpunkArticle(ctx context.Context, doc map[string]any) templ.Component { - return CyberpunkArticle(parseCyberpunkPageData(doc)) -} - -// RenderCyberpunkFullWidth renders the Cyberpunk full-width page template. -func RenderCyberpunkFullWidth(ctx context.Context, doc map[string]any) templ.Component { - return CyberpunkFullWidth(parseCyberpunkPageData(doc)) -} - -var _ = templruntime.GeneratedTemplate diff --git a/templates/cyberpunk/article.ninjatpl b/templates/cyberpunk/article.ninjatpl new file mode 100644 index 0000000..f29971e --- /dev/null +++ b/templates/cyberpunk/article.ninjatpl @@ -0,0 +1,12 @@ + + +{{ head_html|safe }} + + {{ admin_banner_html|safe }} + +
    {{ slots.header|safe }}
    +
    {{ slots.main|safe }}
    +
    {{ slots.footer|safe }}
    + {{ body_end_html|safe }} + + diff --git a/templates/cyberpunk/default.ninjatpl b/templates/cyberpunk/default.ninjatpl new file mode 100644 index 0000000..519ee3a --- /dev/null +++ b/templates/cyberpunk/default.ninjatpl @@ -0,0 +1,12 @@ + + +{{ head_html|safe }} + + {{ admin_banner_html|safe }} + +
    {{ slots.header|safe }}
    +
    {% if slots.main %}{{ slots.main|safe }}{% else %}

    No content blocks assigned to this page.

    {% endif %}
    +
    {{ slots.footer|safe }}
    + {{ body_end_html|safe }} + + diff --git a/templates/cyberpunk/full-width.ninjatpl b/templates/cyberpunk/full-width.ninjatpl new file mode 100644 index 0000000..144ba04 --- /dev/null +++ b/templates/cyberpunk/full-width.ninjatpl @@ -0,0 +1,12 @@ + + +{{ head_html|safe }} + + {{ admin_banner_html|safe }} + +
    {{ slots.header|safe }}
    +
    {% if slots.main %}{{ slots.main|safe }}{% else %}

    No content blocks assigned to this page.

    {% endif %}
    +
    {{ slots.footer|safe }}
    + {{ body_end_html|safe }} + + diff --git a/templates/cyberpunk/landing.ninjatpl b/templates/cyberpunk/landing.ninjatpl new file mode 100644 index 0000000..b070cc0 --- /dev/null +++ b/templates/cyberpunk/landing.ninjatpl @@ -0,0 +1,13 @@ + + +{{ head_html|safe }} + + {{ admin_banner_html|safe }} + +
    {{ slots.hero|safe }}
    +
    {{ slots.features|safe }}
    +
    {{ slots.cta|safe }}
    +
    {{ slots.footer|safe }}
    + {{ body_end_html|safe }} + + diff --git a/templates/email/cyberpunk.ninjatpl b/templates/email/cyberpunk.ninjatpl new file mode 100644 index 0000000..44f618b --- /dev/null +++ b/templates/email/cyberpunk.ninjatpl @@ -0,0 +1,50 @@ + + + + + + + + {{ site_name }} + + + + {% if preview_text %}{% else %}{% endif %} + + + + +
    + + + + + + + + + + + + + + +
    + + diff --git a/templates/overrides/cyberpunk/button.ninjatpl b/templates/overrides/cyberpunk/button.ninjatpl new file mode 100644 index 0000000..9863560 --- /dev/null +++ b/templates/overrides/cyberpunk/button.ninjatpl @@ -0,0 +1 @@ +{% if variant == "secondary" %}{{ label|default:'Button' }} {% elif variant == "ghost" %}{{ label|default:'Button' }} {% else %}{{ label|default:'Button' }} {% endif %} diff --git a/templates/overrides/cyberpunk/card.ninjatpl b/templates/overrides/cyberpunk/card.ninjatpl new file mode 100644 index 0000000..44af74e --- /dev/null +++ b/templates/overrides/cyberpunk/card.ninjatpl @@ -0,0 +1 @@ +{% if href %}{% if media %}{% endif %}{% if title %}

    {{ title }}

    {% endif %}{% if body %}
    {{ body|safe }}
    {% endif %}
    {% else %}
    {% if media %}{% endif %}{% if title %}

    {{ title }}

    {% endif %}{% if body %}
    {{ body|safe }}
    {% endif %}
    {% endif %} diff --git a/templates/overrides/cyberpunk/heading.ninjatpl b/templates/overrides/cyberpunk/heading.ninjatpl new file mode 100644 index 0000000..ad837c4 --- /dev/null +++ b/templates/overrides/cyberpunk/heading.ninjatpl @@ -0,0 +1 @@ +{% if level|integer == 1 %}

    {{ text }}

    {% elif level|integer == 2 %}

    {{ text }}

    {% elif level|integer == 3 %}

    {{ text }}

    {% elif level|integer == 4 %}

    {{ text }}

    {% elif level|integer == 5 %}
    {{ text }}
    {% elif level|integer == 6 %}
    {{ text }}
    {% else %}

    {{ text }}

    {% endif %} diff --git a/templates/overrides/cyberpunk/text.ninjatpl b/templates/overrides/cyberpunk/text.ninjatpl new file mode 100644 index 0000000..e897a38 --- /dev/null +++ b/templates/overrides/cyberpunk/text.ninjatpl @@ -0,0 +1 @@ +
    {{ text|safe }}
    diff --git a/text_override.go b/text_override.go deleted file mode 100644 index 2b27e36..0000000 --- a/text_override.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -import ( - "bytes" - "context" -) - -// CyberpunkTextBlock renders the built-in text block with cyberpunk styling: -// scanline-friendly leading and accent-coloured inline spans. -func CyberpunkTextBlock(ctx context.Context, content map[string]any) string { - text := getString(content, "text") - class := getString(content, "class") - var buf bytes.Buffer - _ = cyberpunkTextComponent(text, class).Render(ctx, &buf) - return buf.String() -} diff --git a/text_override.templ b/text_override.templ deleted file mode 100644 index 87027f6..0000000 --- a/text_override.templ +++ /dev/null @@ -1,12 +0,0 @@ -package main - -// cyberpunkTextComponent renders the override for the built-in text block: -// shadcn `prose` invert with cyberpunk leading and accent inline code. -templ cyberpunkTextComponent(text, class string) { -
    - @templ.Raw(text) -
    -} diff --git a/text_override_templ.go b/text_override_templ.go deleted file mode 100644 index 52d8840..0000000 --- a/text_override_templ.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by templ - DO NOT EDIT. - -// templ: version: v0.3.1020 -package main - -//lint:file-ignore SA4006 This context is only used if a nested component is present. - -import "github.com/a-h/templ" -import templruntime "github.com/a-h/templ/runtime" - -// cyberpunkTextComponent renders the override for the built-in text block: -// shadcn `prose` invert with cyberpunk leading and accent inline code. -func cyberpunkTextComponent(text, class string) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var1 := templ.GetChildren(ctx) - if templ_7745c5c3_Var1 == nil { - templ_7745c5c3_Var1 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - var templ_7745c5c3_Var2 = []any{"cyberpunk-prose prose prose-invert max-w-none leading-relaxed", class} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(text).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "
    ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate