From dc4cc2d8b3cac77a02dd42bf749704c1b71d2214 Mon Sep 17 00:00:00 2001 From: Alex Dunmow Date: Sat, 4 Jul 2026 15:24:40 +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 +- blocks/blocks.yaml | 42 ++ blocks/diagram_caption.ninjatpl | 9 + .../diagram_caption.schema.json | 0 blocks/footer.ninjatpl | 24 + {schemas => blocks}/footer.schema.json | 0 blocks/mission_stat.ninjatpl | 8 + {schemas => blocks}/mission_stat.schema.json | 0 blocks/schematic_hero.ninjatpl | 13 + .../schematic_hero.schema.json | 0 blocks/status_bar.ninjatpl | 27 + {schemas => blocks}/status_bar.schema.json | 0 blocks/tech_spec.ninjatpl | 10 + {schemas => blocks}/tech_spec.schema.json | 0 button_override.go | 22 - button_override.templ | 27 - button_override_templ.go | 112 --- css.go | 119 ---- diagram_caption.go | 63 -- diagram_caption.templ | 49 -- diagram_caption_templ.go | 210 ------ email_wrapper.go | 16 - email_wrapper.templ | 137 ---- email_wrapper_templ.go | 340 --------- embed.go | 60 -- footer.go | 58 -- footer.templ | 69 -- footer_templ.go | 108 --- go.mod | 20 - go.sum | 46 -- heading_override.go | 42 -- heading_override.templ | 48 -- heading_override_templ.go | 338 --------- helpers.go | 82 --- main.go | 17 - manifest.yaml | 140 ++++ master_pages.json | 25 + mission_stat.go | 54 -- mission_stat.templ | 35 - mission_stat_templ.go | 162 ----- plugin.mod | 5 +- register.go | 197 ------ registration.go | 25 - schematic_hero.go | 55 -- schematic_hero.templ | 55 -- schematic_hero_templ.go | 182 ----- status_bar.go | 38 -- status_bar.templ | 46 -- status_bar_templ.go | 84 --- tech_spec.go | 50 -- tech_spec.templ | 53 -- tech_spec_templ.go | 177 ----- template.templ | 281 -------- template_templ.go | 643 ------------------ templates/email/scifi-clean.ninjatpl | 60 ++ .../overrides/scifi-clean/button.ninjatpl | 1 + .../overrides/scifi-clean/heading.ninjatpl | 1 + templates/overrides/scifi-clean/text.ninjatpl | 1 + templates/scifi-clean/article.ninjatpl | 18 + templates/scifi-clean/default.ninjatpl | 13 + templates/scifi-clean/full-width.ninjatpl | 13 + templates/scifi-clean/landing.ninjatpl | 15 + text_override.go | 17 - text_override.templ | 8 - text_override_templ.go | 67 -- 65 files changed, 439 insertions(+), 4238 deletions(-) create mode 100644 blocks/blocks.yaml create mode 100644 blocks/diagram_caption.ninjatpl rename {schemas => blocks}/diagram_caption.schema.json (100%) create mode 100644 blocks/footer.ninjatpl rename {schemas => blocks}/footer.schema.json (100%) create mode 100644 blocks/mission_stat.ninjatpl rename {schemas => blocks}/mission_stat.schema.json (100%) create mode 100644 blocks/schematic_hero.ninjatpl rename {schemas => blocks}/schematic_hero.schema.json (100%) create mode 100644 blocks/status_bar.ninjatpl rename {schemas => blocks}/status_bar.schema.json (100%) create mode 100644 blocks/tech_spec.ninjatpl rename {schemas => blocks}/tech_spec.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 css.go delete mode 100644 diagram_caption.go delete mode 100644 diagram_caption.templ delete mode 100644 diagram_caption_templ.go delete mode 100644 email_wrapper.go delete mode 100644 email_wrapper.templ delete mode 100644 email_wrapper_templ.go delete mode 100644 embed.go delete mode 100644 footer.go delete mode 100644 footer.templ delete mode 100644 footer_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 main.go create mode 100644 manifest.yaml create mode 100644 master_pages.json delete mode 100644 mission_stat.go delete mode 100644 mission_stat.templ delete mode 100644 mission_stat_templ.go delete mode 100644 register.go delete mode 100644 registration.go delete mode 100644 schematic_hero.go delete mode 100644 schematic_hero.templ delete mode 100644 schematic_hero_templ.go delete mode 100644 status_bar.go delete mode 100644 status_bar.templ delete mode 100644 status_bar_templ.go delete mode 100644 tech_spec.go delete mode 100644 tech_spec.templ delete mode 100644 tech_spec_templ.go delete mode 100644 template.templ delete mode 100644 template_templ.go create mode 100644 templates/email/scifi-clean.ninjatpl create mode 100644 templates/overrides/scifi-clean/button.ninjatpl create mode 100644 templates/overrides/scifi-clean/heading.ninjatpl create mode 100644 templates/overrides/scifi-clean/text.ninjatpl create mode 100644 templates/scifi-clean/article.ninjatpl create mode 100644 templates/scifi-clean/default.ninjatpl create mode 100644 templates/scifi-clean/full-width.ninjatpl create mode 100644 templates/scifi-clean/landing.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 3fbff95..9f53f57 100644 --- a/Makefile +++ b/Makefile @@ -1,26 +1,27 @@ -# scifi-clean — build & publish helpers (wasm .bnp workflow) +# scifi-clean — 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 scifi-clean-.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 scifi-clean-.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 := scifi-clean 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/blocks/blocks.yaml b/blocks/blocks.yaml new file mode 100644 index 0000000..c7af007 --- /dev/null +++ b/blocks/blocks.yaml @@ -0,0 +1,42 @@ +# Sci-Fi Clean theme block definitions (codeless .bnp, WO-WZ-021). +# Keys are fully qualified (scifi-clean:) 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: scifi-clean:tech_spec + title: Tech Spec Table + description: Specification table with right-aligned mono numerals and hairline rows. + category: content + schema: tech_spec.schema.json + template: tech_spec.ninjatpl + - key: scifi-clean:diagram_caption + title: Diagram Caption + description: Annotated technical figure with a Fig. NN. heading and optional callout pins. + category: content + schema: diagram_caption.schema.json + template: diagram_caption.ninjatpl + - key: scifi-clean:mission_stat + title: Mission Stat + description: Headline metric in mono numerals with a signal-orange delta arrow. + category: content + schema: mission_stat.schema.json + template: mission_stat.ninjatpl + - key: scifi-clean:status_bar + title: Status Bar + description: Persistent top rail with optional UTC clock, build hash, and callsign. + category: navigation + schema: status_bar.schema.json + template: status_bar.ninjatpl + - key: scifi-clean:footer + title: Instrument Footer + description: Hairline-rule footer with callsign, optional signup, and link list. + category: layout + schema: footer.schema.json + template: footer.ninjatpl + - key: scifi-clean:schematic_hero + title: Schematic Hero + description: Landing hero with a large display title over a blueprint image and dual CTAs. + category: layout + schema: schematic_hero.schema.json + template: schematic_hero.ninjatpl diff --git a/blocks/diagram_caption.ninjatpl b/blocks/diagram_caption.ninjatpl new file mode 100644 index 0000000..b5c71c5 --- /dev/null +++ b/blocks/diagram_caption.ninjatpl @@ -0,0 +1,9 @@ +
+
+ {% if image %}{{ title }}{% for pin in calloutPins %}{{ pin.label }}{% endfor %}{% else %}
No diagram yet
{% endif %} +
+
+

Fig. {% if figureNumber %}{{ figureNumber }}{% else %}00{% endif %} . {% if title %}{{ title }}{% endif %}

+ {% if body %}
{{ body|safe }}
{% endif %} +
+
diff --git a/schemas/diagram_caption.schema.json b/blocks/diagram_caption.schema.json similarity index 100% rename from schemas/diagram_caption.schema.json rename to blocks/diagram_caption.schema.json diff --git a/blocks/footer.ninjatpl b/blocks/footer.ninjatpl new file mode 100644 index 0000000..862bbea --- /dev/null +++ b/blocks/footer.ninjatpl @@ -0,0 +1,24 @@ +
+
+
+
+
+
{{ callsign|default:"SCF-CLN" }}
+

Telemetry, mission briefs, and engineering notes from this surface.

+
+ {% if links %}{% endif %} + {% if showSignup == true or showSignup == "true" %}
+ +
+ + +
+
{% endif %} +
+
+ Project Aurora + v0.1.0 +
+
+
+
diff --git a/schemas/footer.schema.json b/blocks/footer.schema.json similarity index 100% rename from schemas/footer.schema.json rename to blocks/footer.schema.json diff --git a/blocks/mission_stat.ninjatpl b/blocks/mission_stat.ninjatpl new file mode 100644 index 0000000..4fa1772 --- /dev/null +++ b/blocks/mission_stat.ninjatpl @@ -0,0 +1,8 @@ +
+ {% if metric %}
{{ metric }}
{% endif %} +
+ {% if value %}{{ value }}{% else %}—{% endif %} + {% if unit %}{{ unit }}{% endif %} +
+ {% if delta %}
{% if trend == "up" %}↑{% elif trend == "down" %}↓{% else %}→{% endif %} {{ delta }}
{% endif %} +
diff --git a/schemas/mission_stat.schema.json b/blocks/mission_stat.schema.json similarity index 100% rename from schemas/mission_stat.schema.json rename to blocks/mission_stat.schema.json diff --git a/blocks/schematic_hero.ninjatpl b/blocks/schematic_hero.ninjatpl new file mode 100644 index 0000000..d115a7d --- /dev/null +++ b/blocks/schematic_hero.ninjatpl @@ -0,0 +1,13 @@ +
+ {% if image %}
{% endif %} +
+
+ {% if kicker %}
{{ kicker }}
{% endif %} +

{% if title %}{{ title }}{% else %}Untitled mission{% endif %}

+
+ {% if primaryCta.text and primaryCta.href %}{{ primaryCta.text }}{% endif %} + {% if secondaryCta.text and secondaryCta.href %}{{ secondaryCta.text }}{% endif %} +
+
+
+
diff --git a/schemas/schematic_hero.schema.json b/blocks/schematic_hero.schema.json similarity index 100% rename from schemas/schematic_hero.schema.json rename to blocks/schematic_hero.schema.json diff --git a/blocks/status_bar.ninjatpl b/blocks/status_bar.ninjatpl new file mode 100644 index 0000000..de2bb86 --- /dev/null +++ b/blocks/status_bar.ninjatpl @@ -0,0 +1,27 @@ +
+
+
+ {{ callsign|default:"SCF-CLN" }} + | + PUBLIC +
+
+ {% if showClock != false and showClock != "false" %}00:00:00 UTC{% endif %} + {% if showBuild != false and showBuild != "false" %}| + BLD a1b2c3{% endif %} +
+
+ +
diff --git a/schemas/status_bar.schema.json b/blocks/status_bar.schema.json similarity index 100% rename from schemas/status_bar.schema.json rename to blocks/status_bar.schema.json diff --git a/blocks/tech_spec.ninjatpl b/blocks/tech_spec.ninjatpl new file mode 100644 index 0000000..66ee48e --- /dev/null +++ b/blocks/tech_spec.ninjatpl @@ -0,0 +1,10 @@ +
+
+ {% if caption %}

{{ caption }}

{% endif %} + + + {% if rows %}{% for row in rows %}{% endfor %}{% else %}{% endif %} + +
{{ row.label }}{{ row.value }}{{ row.unit }}
No spec rows yet.--
+
+
diff --git a/schemas/tech_spec.schema.json b/blocks/tech_spec.schema.json similarity index 100% rename from schemas/tech_spec.schema.json rename to blocks/tech_spec.schema.json diff --git a/button_override.go b/button_override.go deleted file mode 100644 index f1f4f0b..0000000 --- a/button_override.go +++ /dev/null @@ -1,22 +0,0 @@ -package main - -import ( - "bytes" - "context" -) - -// ScifiButtonBlock renders a button with the Sci-Fi Clean treatment: -// mono uppercase label, hairline outline variant, right-arrow chevron suffix. -// Built-in button content shape: {"text": "...", "url": "...", "variant": "primary|outline"}. -func ScifiButtonBlock(ctx context.Context, content map[string]any) string { - text := getString(content, "text") - url := getString(content, "url") - variant := getStringDefault(content, "variant", "primary") - if text == "" { - return "" - } - - var buf bytes.Buffer - _ = scifiButtonComponent(text, url, variant).Render(ctx, &buf) - return buf.String() -} diff --git a/button_override.templ b/button_override.templ deleted file mode 100644 index 72c9024..0000000 --- a/button_override.templ +++ /dev/null @@ -1,27 +0,0 @@ -package main - -// scifiButtonComponent renders the Sci-Fi Clean button. The `→` chevron is a -// literal U+2192 inside an explicit data-icon span so UAT §13.14 can grep -// for it deterministically. -templ scifiButtonComponent(text, url, variant string) { - - { text } - - -} - -// buttonVariantClass picks the visual treatment. -func buttonVariantClass(variant string) string { - switch variant { - case "outline": - return "hairline text-foreground bg-transparent" - case "destructive": - return "bg-destructive text-destructive-foreground" - default: - return "bg-primary text-primary-foreground" - } -} diff --git a/button_override_templ.go b/button_override_templ.go deleted file mode 100644 index 79695fe..0000000 --- a/button_override_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" - -// scifiButtonComponent renders the Sci-Fi Clean button. The `→` chevron is a -// literal U+2192 inside an explicit data-icon span so UAT §13.14 can grep -// for it deterministically. -func scifiButtonComponent(text, url, 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) - var templ_7745c5c3_Var2 = []any{"scifi-mono uppercase tracking-widest text-xs px-5 py-3 scifi-focus inline-flex items-center justify-center gap-2", buttonVariantClass(variant)} - 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: `button_override.templ`, Line: 12, Col: 14} - } - _, 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 - } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("→") - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `button_override.templ`, Line: 13, Col: 60} - } - _, 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, 5, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// buttonVariantClass picks the visual treatment. -func buttonVariantClass(variant string) string { - switch variant { - case "outline": - return "hairline text-foreground bg-transparent" - case "destructive": - return "bg-destructive text-destructive-foreground" - default: - return "bg-primary text-primary-foreground" - } -} - -var _ = templruntime.GeneratedTemplate diff --git a/css.go b/css.go deleted file mode 100644 index 25daed3..0000000 --- a/css.go +++ /dev/null @@ -1,119 +0,0 @@ -package main - -// scifiCleanInputCSS is appended to the host Tailwind input.css via CSSManifest. -// -// Contents: -// 1. CSS-variable fallback stacks for --font-heading / --font-body / --font-mono. -// Per docs/FONTS.md (wave-1 policy), the theme bundles no fonts and consumes -// fonts exclusively via these variables. The fallback stacks intentionally -// already approximate Sci-Fi Clean's aesthetic so the theme looks right -// before the admin picks any Google Fonts. -// 2. .hairline utility — exactly border: 1px solid hsl(var(--border)). -// UAT §13.5 mandates 1px width; do not raise. -// 3. .bg-grid utility — translucent blueprint grid as a CSS gradient. -// Uses currentColor + opacity to track --foreground. -// 4. .tabular-nums / .mono-numerals helpers — UAT §13.7 wants -// font-variant-numeric: tabular-nums on every mission_stat value. -// 5. .scrim utility — required scrim layer for full-bleed hero text (UAT §6). -// -// The literal substrings 'Space Grotesk', 'JetBrains Mono', '.hairline', '.bg-grid' -// must appear here verbatim (UAT §13.4). -const scifiCleanInputCSS = ` -/* === Sci-Fi Clean: font-family fallback variables === - * The site admin assigns real fonts via the typography settings; until then, - * the variables fall through to the stacks below. 'Space Grotesk', 'Inter', - * and 'JetBrains Mono' are spec §5 recommendations, available in the Google - * Fonts picker. - */ -:root { - --font-heading: "Space Grotesk", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif; - --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif; - --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; -} - -/* === Sci-Fi Clean: utilities === - * Hairline rules and a translucent blueprint grid are the two utility classes - * the theme uses heavily. Tailwind's defaults cover everything else. - */ -.hairline { - border: 1px solid hsl(var(--border)); -} - -.hairline-t { - border-top: 1px solid hsl(var(--border)); -} - -.hairline-b { - border-bottom: 1px solid hsl(var(--border)); -} - -.bg-grid { - background-color: hsl(var(--background)); - background-image: - linear-gradient(to right, hsl(var(--border) / 0.6) 1px, transparent 1px), - linear-gradient(to bottom, hsl(var(--border) / 0.6) 1px, transparent 1px); - background-size: 32px 32px; -} - -.mono-numerals { - font-family: var(--font-mono); - font-variant-numeric: tabular-nums; -} - -.tabular-nums { - font-variant-numeric: tabular-nums; -} - -.scrim { - position: relative; -} - -.scrim::before { - content: ""; - position: absolute; - inset: 0; - background-color: hsl(var(--background) / 0.65); - pointer-events: none; -} - -.scrim > * { - position: relative; - z-index: 1; -} - -/* === Sci-Fi Clean: focus rings === - * Use the --ring token (a precise technical blue) for all focus states so - * the keyboard cursor is visible against either preset. - */ -.scifi-focus:focus-visible { - outline: 2px solid hsl(var(--ring)); - outline-offset: 2px; -} - -/* === Sci-Fi Clean: chevron === - * Right-arrow chevron used in ScifiButtonBlock; encoded as Unicode so it - * never breaks across renderers (UAT §13.14). - */ -.scifi-chevron::after { - content: " \2192"; - font-family: var(--font-mono); - margin-left: 0.5rem; -} - -/* === Sci-Fi Clean: heading family === - * The host shadcn layer doesn't apply --font-heading by default; wire it - * up here for the four heading levels we render. - */ -.scifi-h1, .scifi-h2, .scifi-h3, .scifi-h4 { - font-family: var(--font-heading); - font-feature-settings: "ss01" on; -} - -.scifi-body { - font-family: var(--font-body); -} - -.scifi-mono { - font-family: var(--font-mono); -} -` diff --git a/diagram_caption.go b/diagram_caption.go deleted file mode 100644 index 12b5fe3..0000000 --- a/diagram_caption.go +++ /dev/null @@ -1,63 +0,0 @@ -package main - -import ( - "bytes" - "context" - "strconv" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// DiagramCaptionBlockMeta defines metadata for the diagram-caption block. -var DiagramCaptionBlockMeta = blocks.BlockMeta{ - Key: "diagram_caption", - Title: "Diagram Caption", - Description: "Annotated technical figure with a Fig. NN. heading and optional callout pins.", - Source: "scifi-clean", - Category: blocks.CategoryContent, -} - -// DiagramCalloutPin is a percent-positioned overlay pin. -type DiagramCalloutPin struct { - X float64 - Y float64 - Label string -} - -// DiagramCaptionData drives the templ render. -type DiagramCaptionData struct { - Image string - FigureNumber string - Title string - Body string - CalloutPins []DiagramCalloutPin -} - -// DiagramCaptionBlock renders the diagram-caption block. -// Content shape: {"image": "media:...", "figureNumber": "...", "title": "...", "body": "...", -// "calloutPins": [{"x": 12, "y": 50, "label": "..."}]} -func DiagramCaptionBlock(ctx context.Context, content map[string]any) string { - data := DiagramCaptionData{ - Image: blocks.ResolveMediaPath(getString(content, "image")), - FigureNumber: getString(content, "figureNumber"), - Title: getString(content, "title"), - Body: getString(content, "body"), - } - - for _, raw := range getSlice(content, "calloutPins") { - data.CalloutPins = append(data.CalloutPins, DiagramCalloutPin{ - X: getFloat(raw, "x", 0), - Y: getFloat(raw, "y", 0), - Label: getString(raw, "label"), - }) - } - - var buf bytes.Buffer - _ = diagramCaptionComponent(data).Render(ctx, &buf) - return buf.String() -} - -// percentStyle returns a tiny inline style string positioning the pin in percent. -func percentStyle(x, y float64) string { - return "left: " + strconv.FormatFloat(x, 'f', 2, 64) + "%; top: " + strconv.FormatFloat(y, 'f', 2, 64) + "%;" -} diff --git a/diagram_caption.templ b/diagram_caption.templ deleted file mode 100644 index 32fb7f4..0000000 --- a/diagram_caption.templ +++ /dev/null @@ -1,49 +0,0 @@ -package main - -// diagramCaptionComponent renders the figure with overlay pins and a Fig. heading. -templ diagramCaptionComponent(data DiagramCaptionData) { -
-
- if data.Image == "" { -
- - No diagram yet - -
- } else { - { - for _, pin := range data.CalloutPins { - - { pin.Label } - - } - } -
-
-

- { "Fig. " } - if data.FigureNumber != "" { - { data.FigureNumber } - } else { - { "00" } - } - { "." } - if data.Title != "" { - { data.Title } - } -

- if data.Body != "" { -
- @templ.Raw(data.Body) -
- } -
-
-} diff --git a/diagram_caption_templ.go b/diagram_caption_templ.go deleted file mode 100644 index 65d9daa..0000000 --- a/diagram_caption_templ.go +++ /dev/null @@ -1,210 +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" - -// diagramCaptionComponent renders the figure with overlay pins and a Fig. heading. -func diagramCaptionComponent(data DiagramCaptionData) 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.Image == "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "
No diagram yet
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\"") ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - for _, pin := range data.CalloutPins { - 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(pin.Label) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `diagram_caption.templ`, Line: 24, 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, 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 - } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("Fig. ") - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `diagram_caption.templ`, Line: 31, Col: 13} - } - _, 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, 10, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.FigureNumber != "" { - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.FigureNumber) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `diagram_caption.templ`, Line: 33, Col: 24} - } - _, 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 - } - } else { - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs("00") - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `diagram_caption.templ`, Line: 35, Col: 11} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) - 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_Var9 string - templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(".") - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `diagram_caption.templ`, Line: 37, Col: 9} - } - _, 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, 13, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.Title != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var10 string - templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(data.Title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `diagram_caption.templ`, Line: 39, Col: 58} - } - _, 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, 15, "") - 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 - } - if data.Body != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "
") - 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, 18, "
") - 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 - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/email_wrapper.go b/email_wrapper.go deleted file mode 100644 index 9481082..0000000 --- a/email_wrapper.go +++ /dev/null @@ -1,16 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/templates" -) - -// ScifiEmailWrapper wraps body content in a branded Sci-Fi Clean email shell: -// 600px white card, hairline border, mono callsign top-right, instrument footer. -func ScifiEmailWrapper(body string, emailCtx templates.EmailContext) string { - var buf bytes.Buffer - _ = scifiEmailTemplate(emailCtx, body).Render(context.Background(), &buf) - return buf.String() -} diff --git a/email_wrapper.templ b/email_wrapper.templ deleted file mode 100644 index ec3b132..0000000 --- a/email_wrapper.templ +++ /dev/null @@ -1,137 +0,0 @@ -package main - -import ( - "fmt" - - "git.dev.alexdunmow.com/block/core/templates" -) - -// scifiEmailBgColor / scifiEmailCardColor / scifiEmailBorderColor pull from the -// caller-provided EmailColors so the wrapper inherits the active preset. -func scifiEmailBgColor(c templates.EmailContext) string { - if c.Colors.Background != "" { - return c.Colors.Background - } - return "#F6F7F8" -} - -func scifiEmailCardColor(c templates.EmailContext) string { - if c.Colors.Card != "" { - return c.Colors.Card - } - return "#FFFFFF" -} - -func scifiEmailBorderColor(c templates.EmailContext) string { - if c.Colors.Border != "" { - return c.Colors.Border - } - return "#D6D9DD" -} - -func scifiEmailFgColor(c templates.EmailContext) string { - if c.Colors.Foreground != "" { - return c.Colors.Foreground - } - return "#16202E" -} - -func scifiEmailMutedColor(c templates.EmailContext) string { - if c.Colors.MutedForeground != "" { - return c.Colors.MutedForeground - } - return "#5C6776" -} - -func scifiEmailCallsign(c templates.EmailContext) string { - if c.SiteSettings.SiteName != "" { - return "SCF / " + c.SiteSettings.SiteName - } - return "SCF-CLN" -} - -// scifiEmailTemplate is the Sci-Fi Clean branded email wrapper. -templ scifiEmailTemplate(emailCtx templates.EmailContext, body string) { - - - - - - - { emailCtx.SiteSettings.SiteName } - - - - if emailCtx.PreviewText != "" { -
{ emailCtx.PreviewText }
- } - - - - -
- - - - - - - - - - - -
- - -} diff --git a/email_wrapper_templ.go b/email_wrapper_templ.go deleted file mode 100644 index 07a75e1..0000000 --- a/email_wrapper_templ.go +++ /dev/null @@ -1,340 +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 ( - "fmt" - - "git.dev.alexdunmow.com/block/core/templates" -) - -// scifiEmailBgColor / scifiEmailCardColor / scifiEmailBorderColor pull from the -// caller-provided EmailColors so the wrapper inherits the active preset. -func scifiEmailBgColor(c templates.EmailContext) string { - if c.Colors.Background != "" { - return c.Colors.Background - } - return "#F6F7F8" -} - -func scifiEmailCardColor(c templates.EmailContext) string { - if c.Colors.Card != "" { - return c.Colors.Card - } - return "#FFFFFF" -} - -func scifiEmailBorderColor(c templates.EmailContext) string { - if c.Colors.Border != "" { - return c.Colors.Border - } - return "#D6D9DD" -} - -func scifiEmailFgColor(c templates.EmailContext) string { - if c.Colors.Foreground != "" { - return c.Colors.Foreground - } - return "#16202E" -} - -func scifiEmailMutedColor(c templates.EmailContext) string { - if c.Colors.MutedForeground != "" { - return c.Colors.MutedForeground - } - return "#5C6776" -} - -func scifiEmailCallsign(c templates.EmailContext) string { - if c.SiteSettings.SiteName != "" { - return "SCF / " + c.SiteSettings.SiteName - } - return "SCF-CLN" -} - -// scifiEmailTemplate is the Sci-Fi Clean branded email wrapper. -func scifiEmailTemplate(emailCtx templates.EmailContext, body 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) - 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(emailCtx.SiteSettings.SiteName) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `email_wrapper.templ`, Line: 61, Col: 42} - } - _, 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 emailCtx.PreviewText != "" { - 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: 82, Col: 87} - } - _, 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 - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var9 string - templ_7745c5c3_Var9, 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: 101, Col: 44} - } - _, 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, 11, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var11 string - templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(scifiEmailCallsign(emailCtx)) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `email_wrapper.templ`, Line: 104, Col: 42} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) - 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, 15, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if emailCtx.UnsubscribeURL != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var15 string - templ_7745c5c3_Var15, 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: 120, Col: 43} - } - _, 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, 18, "Unsubscribe
") - 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 59d2496..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. -func Assets() fs.FS { - sub, _ := fs.Sub(assetsFS, "assets") - return sub -} - -// Schemas returns the embedded schemas filesystem. -func Schemas() fs.FS { - sub, _ := fs.Sub(schemasFS, "schemas") - return sub -} - -// AssetsHandler returns an http.Handler that serves the embedded assets. -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 returns the CSS manifest containing the theme's custom -// utilities (.hairline, .bg-grid) and font-family fallback CSS variables. -// It is injected into the host Tailwind input by the CMS at build time. -func ThemeCSSManifest() *plugin.CSSManifest { - return &plugin.CSSManifest{ - InputCSSAppend: scifiCleanInputCSS, - } -} diff --git a/footer.go b/footer.go deleted file mode 100644 index 0ebb25b..0000000 --- a/footer.go +++ /dev/null @@ -1,58 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// FooterBlockMeta defines metadata for the instrument footer block. -var FooterBlockMeta = blocks.BlockMeta{ - Key: "footer", - Title: "Instrument Footer", - Description: "Hairline-rule footer with callsign, optional signup, and link list.", - Source: "scifi-clean", - Category: blocks.CategoryLayout, -} - -// FooterLink is one footer link entry. -type FooterLink struct { - Text string - URL string -} - -// FooterData drives the templ render. -type FooterData struct { - ShowSignup bool - Callsign string - Links []FooterLink -} - -// FooterBlock renders the footer. -// Content shape: {"showSignup": false, "callsign": "SCF-CLN", "links": [{"text": "...", "url": "..."}]} -func FooterBlock(ctx context.Context, content map[string]any) string { - data := FooterData{ - ShowSignup: getBool(content, "showSignup", false), - Callsign: getStringDefault(content, "callsign", "SCF-CLN"), - } - - for _, raw := range getSlice(content, "links") { - data.Links = append(data.Links, FooterLink{ - Text: getString(raw, "text"), - URL: getString(raw, "url"), - }) - } - - var buf bytes.Buffer - _ = footerComponent(data).Render(ctx, &buf) - return buf.String() -} - -// safeHref returns # for blank URLs so the templ.SafeURL helper has something to chew on. -func safeHref(u string) string { - if u == "" { - return "#" - } - return u -} diff --git a/footer.templ b/footer.templ deleted file mode 100644 index 7b5ae61..0000000 --- a/footer.templ +++ /dev/null @@ -1,69 +0,0 @@ -package main - -// footerComponent renders the instrument-bar footer. -// UAT §13.10 requires a callsign element rendered in JetBrains Mono and at -// least one .hairline rule above the footer. -templ footerComponent(data FooterData) { -
-
-
-
-
-
- { data.Callsign } -
-

- Telemetry, mission briefs, and engineering notes from this surface. -

-
- - if len(data.Links) > 0 { - - } - - if data.ShowSignup { -
- -
- - -
-
- } -
-
- Project Aurora - v0.1.0 -
-
-
-
-} diff --git a/footer_templ.go b/footer_templ.go deleted file mode 100644 index 058ae69..0000000 --- a/footer_templ.go +++ /dev/null @@ -1,108 +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" - -// footerComponent renders the instrument-bar footer. -// UAT §13.10 requires a callsign element rendered in JetBrains Mono and at -// least one .hairline rule above the footer. -func footerComponent(data FooterData) 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.Callsign) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `footer.templ`, Line: 17, Col: 22} - } - _, 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, "

Telemetry, mission briefs, and engineering notes from this surface.

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if len(data.Links) > 0 { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if data.ShowSignup { - 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, "
Project Aurora v0.1.0
") - 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 e866e1d..0000000 --- a/go.mod +++ /dev/null @@ -1,20 +0,0 @@ -module git.dev.alexdunmow.com/block/themes/scifi-clean - -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 126058f..0000000 --- a/heading_override.go +++ /dev/null @@ -1,42 +0,0 @@ -package main - -import ( - "bytes" - "context" - "strconv" -) - -// ScifiHeadingBlock renders a heading with the Sci-Fi Clean treatment: -// Space Grotesk weights, optional mono kicker prefix ("FIG / SEC / SYS" etc.). -// Reuses the built-in heading schema; reads optional kicker via content["kicker"]. -func ScifiHeadingBlock(ctx context.Context, content map[string]any) string { - text := getString(content, "text") - textClass := getString(content, "textClass") - kicker := getString(content, "kicker") - level := parseHeadingLevel(content) - - var buf bytes.Buffer - _ = scifiHeadingComponent(level, text, textClass, kicker).Render(ctx, &buf) - return buf.String() -} - -// parseHeadingLevel coerces an incoming heading level to 1..6, defaulting to 2. -func parseHeadingLevel(content map[string]any) int { - if level, ok := content["level"].(float64); ok { - l := int(level) - if l >= 1 && l <= 6 { - return l - } - } - if level, ok := content["level"].(int); ok { - if level >= 1 && level <= 6 { - return level - } - } - if level, ok := content["level"].(string); ok { - if l, err := strconv.Atoi(level); err == nil && l >= 1 && l <= 6 { - return l - } - } - return 2 -} diff --git a/heading_override.templ b/heading_override.templ deleted file mode 100644 index 5869acf..0000000 --- a/heading_override.templ +++ /dev/null @@ -1,48 +0,0 @@ -package main - -// scifiHeadingBaseClass returns level-specific tracking + weight classes. -func scifiHeadingBaseClass(level int) string { - switch level { - case 1: - return "scifi-h1 text-4xl md:text-5xl font-medium tracking-tight" - case 2: - return "scifi-h2 text-3xl font-medium tracking-tight" - case 3: - return "scifi-h3 text-2xl font-medium" - case 4: - return "scifi-h4 text-xl font-medium" - case 5: - return "scifi-h4 text-lg font-medium" - case 6: - return "scifi-h4 text-base font-medium uppercase tracking-widest" - default: - return "scifi-h2 text-3xl font-medium tracking-tight" - } -} - -// scifiHeadingComponent renders a heading with an optional mono kicker rail. -templ scifiHeadingComponent(level int, text, textClass, kicker string) { -
- if kicker != "" { -
- { kicker } -
- } - 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 28754c9..0000000 --- a/heading_override_templ.go +++ /dev/null @@ -1,338 +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" - -// scifiHeadingBaseClass returns level-specific tracking + weight classes. -func scifiHeadingBaseClass(level int) string { - switch level { - case 1: - return "scifi-h1 text-4xl md:text-5xl font-medium tracking-tight" - case 2: - return "scifi-h2 text-3xl font-medium tracking-tight" - case 3: - return "scifi-h3 text-2xl font-medium" - case 4: - return "scifi-h4 text-xl font-medium" - case 5: - return "scifi-h4 text-lg font-medium" - case 6: - return "scifi-h4 text-base font-medium uppercase tracking-widest" - default: - return "scifi-h2 text-3xl font-medium tracking-tight" - } -} - -// scifiHeadingComponent renders a heading with an optional mono kicker rail. -func scifiHeadingComponent(level int, text, textClass, kicker 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) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if kicker != "" { - 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(kicker) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 28, Col: 12} - } - _, 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 - } - } - switch level { - case 1: - var templ_7745c5c3_Var3 = []any{scifiHeadingBaseClass(1), "text-foreground", textClass} - 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 - } - 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: 33, Col: 121} - } - _, 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 - } - case 2: - var templ_7745c5c3_Var6 = []any{scifiHeadingBaseClass(2), "text-foreground", 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, 7, "

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 35, Col: 121} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) - 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 - } - case 3: - var templ_7745c5c3_Var9 = []any{scifiHeadingBaseClass(3), "text-foreground", textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var9...) - 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_Var11 string - templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 37, Col: 121} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) - 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 - } - case 4: - var templ_7745c5c3_Var12 = []any{scifiHeadingBaseClass(4), "text-foreground", textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var12...) - 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 - } - var templ_7745c5c3_Var14 string - templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 39, Col: 121} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) - 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 - } - case 5: - var templ_7745c5c3_Var15 = []any{scifiHeadingBaseClass(5), "text-foreground", textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var15...) - 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 - } - var templ_7745c5c3_Var17 string - templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 41, Col: 121} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) - 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 - } - case 6: - var templ_7745c5c3_Var18 = []any{scifiHeadingBaseClass(6), "text-muted-foreground", textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var18...) - 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 - } - var templ_7745c5c3_Var20 string - templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 43, Col: 127} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) - 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 - } - default: - var templ_7745c5c3_Var21 = []any{scifiHeadingBaseClass(2), "text-foreground", textClass} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var21...) - 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 - } - var templ_7745c5c3_Var23 string - templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `heading_override.templ`, Line: 45, Col: 121} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) - 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "
") - 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 d3a77f9..0000000 --- a/helpers.go +++ /dev/null @@ -1,82 +0,0 @@ -package main - -// getString extracts a string value from a content map. -func getString(content map[string]any, key string) string { - if v, ok := content[key].(string); ok { - return v - } - return "" -} - -// getStringDefault returns the string at key, falling back to def if missing/blank. -func getStringDefault(content map[string]any, key, def string) string { - if v := getString(content, key); v != "" { - return v - } - return def -} - -// getBool extracts a boolean from a content map. Accepts native bool, string ("true"/"1"), -// or numeric truthiness. Returns def when no value is present or parseable. -func getBool(content map[string]any, key string, def bool) bool { - if v, ok := content[key]; ok { - switch t := v.(type) { - case bool: - return t - case string: - switch t { - case "true", "TRUE", "True", "1", "yes", "on": - return true - case "false", "FALSE", "False", "0", "no", "off": - return false - } - case float64: - return t != 0 - case int: - return t != 0 - } - } - return def -} - -// getSlice extracts a slice of maps from content under key. Returns nil if not a slice. -func getSlice(content map[string]any, key string) []map[string]any { - if v, ok := content[key].([]any); ok { - 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 - } - return nil -} - -// getMap returns the map at key, or nil. -func getMap(content map[string]any, key string) map[string]any { - if m, ok := content[key].(map[string]any); ok { - return m - } - return nil -} - -// getFloat returns the float at key, or def if missing / wrong type. -func getFloat(content map[string]any, key string, def float64) float64 { - if v, ok := content[key].(float64); ok { - return v - } - if v, ok := content[key].(int); ok { - return float64(v) - } - return def -} - -// normalizeTrend coerces an incoming trend string to {up, down, flat}, defaulting to flat. -func normalizeTrend(s string) string { - switch s { - case "up", "down", "flat": - return s - } - return "flat" -} diff --git a/main.go b/main.go deleted file mode 100644 index b022475..0000000 --- a/main.go +++ /dev/null @@ -1,17 +0,0 @@ -//go:build wasip1 - -// Package main compiles the scifi-clean 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..655356f --- /dev/null +++ b/manifest.yaml @@ -0,0 +1,140 @@ +# Sci-Fi Clean theme — codeless .bnp manifest (WO-WZ-021 Phase B1). +# 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: scifi-clean + title: Sci-Fi Clean + description: "Minimalist futurist theme for aerospace, robotics, and R&D — off-white surfaces, technical blue, signal-orange accents, mono numerals." + +page_templates: + - system: scifi-clean + key: default + title: Default + description: "Standard cleanroom layout with header rail, main column, and footer instrument panel." + slots: [header, main, footer] + - system: scifi-clean + key: landing + title: Landing + description: "Hero diagram + spec strip + CTA banner." + slots: [hero, specs, main, cta, footer] + - system: scifi-clean + key: article + title: Article + description: "Narrow column with rail metadata and figure margin." + slots: [header, rail, main, footer] + - system: scifi-clean + key: full-width + title: Full Width + description: "Edge-to-edge schematic surface for diagrams and dashboards." + slots: [header, main, footer] + +template_overrides: + - { template: scifi-clean, block: heading } + - { template: scifi-clean, block: text } + - { template: scifi-clean, block: button } + +email_wrappers: + - scifi-clean + +css: + input_css_append: | + /* === Sci-Fi Clean: font-family fallback variables === + * The site admin assigns real fonts via the typography settings; until then, + * the variables fall through to the stacks below. 'Space Grotesk', 'Inter', + * and 'JetBrains Mono' are spec §5 recommendations, available in the Google + * Fonts picker. + */ + :root { + --font-heading: "Space Grotesk", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif; + --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif; + --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; + } + + /* === Sci-Fi Clean: utilities === + * Hairline rules and a translucent blueprint grid are the two utility classes + * the theme uses heavily. Tailwind's defaults cover everything else. + */ + .hairline { + border: 1px solid hsl(var(--border)); + } + + .hairline-t { + border-top: 1px solid hsl(var(--border)); + } + + .hairline-b { + border-bottom: 1px solid hsl(var(--border)); + } + + .bg-grid { + background-color: hsl(var(--background)); + background-image: + linear-gradient(to right, hsl(var(--border) / 0.6) 1px, transparent 1px), + linear-gradient(to bottom, hsl(var(--border) / 0.6) 1px, transparent 1px); + background-size: 32px 32px; + } + + .mono-numerals { + font-family: var(--font-mono); + font-variant-numeric: tabular-nums; + } + + .tabular-nums { + font-variant-numeric: tabular-nums; + } + + .scrim { + position: relative; + } + + .scrim::before { + content: ""; + position: absolute; + inset: 0; + background-color: hsl(var(--background) / 0.65); + pointer-events: none; + } + + .scrim > * { + position: relative; + z-index: 1; + } + + /* === Sci-Fi Clean: focus rings === + * Use the --ring token (a precise technical blue) for all focus states so + * the keyboard cursor is visible against either preset. + */ + .scifi-focus:focus-visible { + outline: 2px solid hsl(var(--ring)); + outline-offset: 2px; + } + + /* === Sci-Fi Clean: chevron === + * Right-arrow chevron used in ScifiButtonBlock; encoded as Unicode so it + * never breaks across renderers (UAT §13.14). + */ + .scifi-chevron::after { + content: " \2192"; + font-family: var(--font-mono); + margin-left: 0.5rem; + } + + /* === Sci-Fi Clean: heading family === + * The host shadcn layer doesn't apply --font-heading by default; wire it + * up here for the four heading levels we render. + */ + .scifi-h1, .scifi-h2, .scifi-h3, .scifi-h4 { + font-family: var(--font-heading); + font-feature-settings: "ss01" on; + } + + .scifi-body { + font-family: var(--font-body); + } + + .scifi-mono { + font-family: var(--font-mono); + } diff --git a/master_pages.json b/master_pages.json new file mode 100644 index 0000000..2a9e990 --- /dev/null +++ b/master_pages.json @@ -0,0 +1,25 @@ +[ + { + "key": "scifi-clean:default-master", + "title": "Sci-Fi Clean Default Master", + "page_templates": ["default", "article", "full-width"], + "blocks": [ + { "block_key": "navbar", "title": "Mission Header", "content": { "menuName": "main" }, "slot": "header", "sort_order": 0 }, + { "block_key": "scifi-clean:status_bar", "title": "System Status Rail", "content": { "showClock": true, "showBuild": true, "callsign": "SCF-CLN" }, "slot": "header", "sort_order": 10 }, + { "block_key": "slot", "title": "Main Content", "content": { "slotName": "main", "placeholder": "Page payload" }, "slot": "main", "sort_order": 0 }, + { "block_key": "scifi-clean:footer", "title": "Instrument Footer", "content": { "showSignup": true, "callsign": "SCF-CLN" }, "slot": "footer", "sort_order": 0 } + ] + }, + { + "key": "scifi-clean:landing-master", + "title": "Sci-Fi Clean Landing Master", + "page_templates": ["landing"], + "blocks": [ + { "block_key": "scifi-clean:status_bar", "title": "System Status Rail", "content": { "showClock": true, "showBuild": true, "callsign": "SCF-CLN" }, "slot": "header", "sort_order": 0 }, + { "block_key": "scifi-clean:mission_stat", "title": "Hero Mission Stat", "content": { "metric": "Apogee", "value": "412", "unit": "km", "delta": "+12", "trend": "up" }, "slot": "hero", "sort_order": 0 }, + { "block_key": "scifi-clean:tech_spec", "title": "Hero Tech Spec", "content": { "caption": "Launch envelope", "rows": [ { "label": "Thrust", "value": "1.42", "unit": "MN" }, { "label": "Burn time", "value": "186", "unit": "s" }, { "label": "Payload", "value": "320", "unit": "kg" } ] }, "slot": "specs", "sort_order": 0 }, + { "block_key": "slot", "title": "Main Content", "content": { "slotName": "main", "placeholder": "Page payload" }, "slot": "main", "sort_order": 0 }, + { "block_key": "scifi-clean:footer", "title": "Instrument Footer", "content": { "showSignup": true, "callsign": "SCF-CLN" }, "slot": "footer", "sort_order": 0 } + ] + } +] diff --git a/mission_stat.go b/mission_stat.go deleted file mode 100644 index 6bd6511..0000000 --- a/mission_stat.go +++ /dev/null @@ -1,54 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// MissionStatBlockMeta defines metadata for the mission-stat block. -var MissionStatBlockMeta = blocks.BlockMeta{ - Key: "mission_stat", - Title: "Mission Stat", - Description: "Headline metric in mono numerals with a signal-orange delta arrow.", - Source: "scifi-clean", - Category: blocks.CategoryContent, -} - -// MissionStatData drives the templ render. -type MissionStatData struct { - Metric string - Value string - Unit string - Delta string - Trend string // "up", "down", "flat" -} - -// MissionStatBlock renders the mission-stat block. -// Content shape: {"metric": "...", "value": "...", "unit": "...", "delta": "...", "trend": "up|down|flat"} -func MissionStatBlock(ctx context.Context, content map[string]any) string { - data := MissionStatData{ - Metric: getString(content, "metric"), - Value: getString(content, "value"), - Unit: getString(content, "unit"), - Delta: getString(content, "delta"), - Trend: normalizeTrend(getString(content, "trend")), - } - - var buf bytes.Buffer - _ = missionStatComponent(data).Render(ctx, &buf) - return buf.String() -} - -// trendGlyph returns the arrow character for a given trend. -func trendGlyph(trend string) string { - switch trend { - case "up": - return "↑" // ↑ - case "down": - return "↓" // ↓ - default: - return "→" // → - } -} diff --git a/mission_stat.templ b/mission_stat.templ deleted file mode 100644 index 8f6b474..0000000 --- a/mission_stat.templ +++ /dev/null @@ -1,35 +0,0 @@ -package main - -// missionStatComponent renders the headline metric card with mono numerals -// and an accent-colored delta arrow. -templ missionStatComponent(data MissionStatData) { -
- if data.Metric != "" { -
- { data.Metric } -
- } -
- - if data.Value == "" { - { "—" } - } else { - { data.Value } - } - - if data.Unit != "" { - - { data.Unit } - - } -
- if data.Delta != "" { -
- { trendGlyph(data.Trend) } { data.Delta } -
- } -
-} diff --git a/mission_stat_templ.go b/mission_stat_templ.go deleted file mode 100644 index 8d6a219..0000000 --- a/mission_stat_templ.go +++ /dev/null @@ -1,162 +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" - -// missionStatComponent renders the headline metric card with mono numerals -// and an accent-colored delta arrow. -func missionStatComponent(data MissionStatData) 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.Metric != "" { - 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(data.Metric) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `mission_stat.templ`, Line: 9, Col: 17} - } - _, 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 - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.Value == "" { - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs("—") - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `mission_stat.templ`, Line: 18, Col: 12} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(data.Value) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `mission_stat.templ`, Line: 20, Col: 17} - } - _, 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 - } - if data.Unit != "" { - 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(data.Unit) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `mission_stat.templ`, Line: 25, Col: 16} - } - _, 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, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.Delta != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(trendGlyph(data.Trend)) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `mission_stat.templ`, Line: 31, 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, 11, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(data.Delta) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `mission_stat.templ`, Line: 31, Col: 43} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) - 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/plugin.mod b/plugin.mod index fe77113..c2ed9d3 100644 --- a/plugin.mod +++ b/plugin.mod @@ -2,11 +2,8 @@ name = "scifi-clean" display_name = "Sci-Fi Clean" scope = "@themes" -version = "0.1.2" +version = "0.2.0" description = "Minimalist futurist theme for aerospace, robotics, and R&D — off-white surfaces, technical blue, signal-orange accents, mono numerals." kind = "theme" categories = ["templates"] tags = ["futurist", "technical", "aerospace", "hardware", "robotics", "biotech", "rnd", "clean", "minimalist"] - -[compatibility] -block_core = ">=0.15.0 <0.16.0" diff --git a/register.go b/register.go deleted file mode 100644 index 9930212..0000000 --- a/register.go +++ /dev/null @@ -1,197 +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. It registers the system template, the -// four page templates, the six theme-specific blocks, the three overrides, -// and the email wrapper. -// -// IMPORTANT: schemas are loaded BEFORE any br.Register(...) call — this is a -// hard rule (CLAUDE.md, UAT §3) so the block registry binds content schemas -// at registration time. -func Register(tr templates.TemplateRegistry, br blocks.BlockRegistry) error { - // --- System template --- - tr.RegisterSystemTemplate(templates.SystemTemplateMeta{ - Key: "scifi-clean", - Title: "Sci-Fi Clean", - Description: "Minimalist futurist theme for aerospace, robotics, and R&D — off-white surfaces, technical blue, signal-orange accents, mono numerals.", - }) - - // --- Page templates (spec §6) --- - if err := tr.RegisterPageTemplate("scifi-clean", templates.PageTemplateMeta{ - Key: "default", - Title: "Default", - Description: "Standard cleanroom layout with header rail, main column, and footer instrument panel.", - Slots: []string{"header", "main", "footer"}, - }, wrap(RenderScifiClean)); err != nil { - return err - } - - if err := tr.RegisterPageTemplate("scifi-clean", templates.PageTemplateMeta{ - Key: "landing", - Title: "Landing", - Description: "Hero diagram + spec strip + CTA banner.", - Slots: []string{"hero", "specs", "main", "cta", "footer"}, - }, wrap(RenderScifiCleanLanding)); err != nil { - return err - } - - if err := tr.RegisterPageTemplate("scifi-clean", templates.PageTemplateMeta{ - Key: "article", - Title: "Article", - Description: "Narrow column with rail metadata and figure margin.", - Slots: []string{"header", "rail", "main", "footer"}, - }, wrap(RenderScifiCleanArticle)); err != nil { - return err - } - - if err := tr.RegisterPageTemplate("scifi-clean", templates.PageTemplateMeta{ - Key: "full-width", - Title: "Full Width", - Description: "Edge-to-edge schematic surface for diagrams and dashboards.", - Slots: []string{"header", "main", "footer"}, - }, wrap(RenderScifiCleanFullWidth)); err != nil { - return err - } - - // --- Load JSON Schemas BEFORE any block registration --- - if err := br.LoadSchemasFromFS(Schemas()); err != nil { - return err - } - - // --- Theme-specific blocks (spec §8) --- - br.Register(TechSpecBlockMeta, TechSpecBlock) - br.Register(DiagramCaptionBlockMeta, DiagramCaptionBlock) - br.Register(MissionStatBlockMeta, MissionStatBlock) - br.Register(StatusBarBlockMeta, StatusBarBlock) - br.Register(FooterBlockMeta, FooterBlock) - br.Register(SchematicHeroBlockMeta, SchematicHeroBlock) - - // --- Built-in overrides (spec §9) --- - br.RegisterTemplateOverride("scifi-clean", "heading", ScifiHeadingBlock) - br.RegisterTemplateOverride("scifi-clean", "text", ScifiTextBlock) - br.RegisterTemplateOverride("scifi-clean", "button", ScifiButtonBlock) - - // --- Email wrapper (spec §10) --- - tr.RegisterEmailWrapper("scifi-clean", ScifiEmailWrapper) - - return nil -} - -// DefaultMasterPages returns the two master pages that Sci-Fi Clean provisions -// on first plugin load (spec §7, UAT §9). -// -// - scifi-clean:default-master → attached to `default`, `article`, `full-width` -// - scifi-clean:landing-master → attached to `landing`, pre-populates `hero` -// with a mission_stat and `specs` with a tech_spec. -func DefaultMasterPages() []plugin.MasterPageDefinition { - defaultMaster := plugin.MasterPageDefinition{ - Key: "scifi-clean:default-master", - Title: "Sci-Fi Clean Default Master", - PageTemplates: []string{"default", "article", "full-width"}, - Blocks: []plugin.MasterPageBlock{ - { - BlockKey: "navbar", - Title: "Mission Header", - Content: map[string]any{"menuName": "main"}, - Slot: "header", - SortOrder: 0, - }, - { - BlockKey: "scifi-clean:status_bar", - Title: "System Status Rail", - Content: map[string]any{"showClock": true, "showBuild": true, "callsign": "SCF-CLN"}, - Slot: "header", - SortOrder: 10, - }, - { - BlockKey: "slot", - Title: "Main Content", - Content: map[string]any{"slotName": "main", "placeholder": "Page payload"}, - Slot: "main", - SortOrder: 0, - }, - { - BlockKey: "scifi-clean:footer", - Title: "Instrument Footer", - Content: map[string]any{"showSignup": true, "callsign": "SCF-CLN"}, - Slot: "footer", - SortOrder: 0, - }, - }, - } - - landingMaster := plugin.MasterPageDefinition{ - Key: "scifi-clean:landing-master", - Title: "Sci-Fi Clean Landing Master", - PageTemplates: []string{"landing"}, - Blocks: []plugin.MasterPageBlock{ - { - BlockKey: "scifi-clean:status_bar", - Title: "System Status Rail", - Content: map[string]any{"showClock": true, "showBuild": true, "callsign": "SCF-CLN"}, - Slot: "header", - SortOrder: 0, - }, - { - BlockKey: "scifi-clean:mission_stat", - Title: "Hero Mission Stat", - Content: map[string]any{ - "metric": "Apogee", - "value": "412", - "unit": "km", - "delta": "+12", - "trend": "up", - }, - Slot: "hero", - SortOrder: 0, - }, - { - BlockKey: "scifi-clean:tech_spec", - Title: "Hero Tech Spec", - Content: map[string]any{ - "caption": "Launch envelope", - "rows": []any{ - map[string]any{"label": "Thrust", "value": "1.42", "unit": "MN"}, - map[string]any{"label": "Burn time", "value": "186", "unit": "s"}, - map[string]any{"label": "Payload", "value": "320", "unit": "kg"}, - }, - }, - Slot: "specs", - SortOrder: 0, - }, - { - BlockKey: "slot", - Title: "Main Content", - Content: map[string]any{"slotName": "main", "placeholder": "Page payload"}, - Slot: "main", - SortOrder: 0, - }, - { - BlockKey: "scifi-clean:footer", - Title: "Instrument Footer", - Content: map[string]any{"showSignup": true, "callsign": "SCF-CLN"}, - Slot: "footer", - SortOrder: 0, - }, - }, - } - - return []plugin.MasterPageDefinition{defaultMaster, landingMaster} -} diff --git a/registration.go b/registration.go deleted file mode 100644 index 79e05e7..0000000 --- a/registration.go +++ /dev/null @@ -1,25 +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 Sci-Fi Clean theme. -var Registration = plugin.PluginRegistration{ - Name: "scifi-clean", - 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() }, -} diff --git a/schematic_hero.go b/schematic_hero.go deleted file mode 100644 index 3aee57b..0000000 --- a/schematic_hero.go +++ /dev/null @@ -1,55 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// SchematicHeroBlockMeta defines metadata for the landing hero. -var SchematicHeroBlockMeta = blocks.BlockMeta{ - Key: "schematic_hero", - Title: "Schematic Hero", - Description: "Landing hero with a large display title over a blueprint image and dual CTAs.", - Source: "scifi-clean", - Category: blocks.CategoryLayout, -} - -// SchematicCTA is a single call-to-action link. -type SchematicCTA struct { - Text string - Href string -} - -// SchematicHeroData drives the templ render. -type SchematicHeroData struct { - Title string - Kicker string - Image string - PrimaryCTA SchematicCTA - SecondaryCTA SchematicCTA -} - -// SchematicHeroBlock renders the landing hero. -// Content shape: {"title": "...", "kicker": "...", "image": "media:...", -// "primaryCta": {"text": "...", "href": "..."}, -// "secondaryCta": {"text": "...", "href": "..."}} -func SchematicHeroBlock(ctx context.Context, content map[string]any) string { - data := SchematicHeroData{ - Title: getString(content, "title"), - Kicker: getString(content, "kicker"), - Image: blocks.ResolveMediaPath(getString(content, "image")), - } - - if m := getMap(content, "primaryCta"); m != nil { - data.PrimaryCTA = SchematicCTA{Text: getString(m, "text"), Href: getString(m, "href")} - } - if m := getMap(content, "secondaryCta"); m != nil { - data.SecondaryCTA = SchematicCTA{Text: getString(m, "text"), Href: getString(m, "href")} - } - - var buf bytes.Buffer - _ = schematicHeroComponent(data).Render(ctx, &buf) - return buf.String() -} diff --git a/schematic_hero.templ b/schematic_hero.templ deleted file mode 100644 index 8d79c82..0000000 --- a/schematic_hero.templ +++ /dev/null @@ -1,55 +0,0 @@ -package main - -// schematicHeroComponent renders the landing-page hero. -// UAT §13.6 requires the

to render in Space Grotesk at >= 64px on 1440x900. -// UAT §6 requires a scrim layer between the background image and the title text. -templ schematicHeroComponent(data SchematicHeroData) { -
- if data.Image != "" { -
- -
- } -
-
- if data.Kicker != "" { -
- { data.Kicker } -
- } -

- if data.Title == "" { - { "Untitled mission" } - } else { - { data.Title } - } -

-
- if data.PrimaryCTA.Text != "" && data.PrimaryCTA.Href != "" { - - { data.PrimaryCTA.Text } - - } - if data.SecondaryCTA.Text != "" && data.SecondaryCTA.Href != "" { - - { data.SecondaryCTA.Text } - - } -
-
-
-
-} diff --git a/schematic_hero_templ.go b/schematic_hero_templ.go deleted file mode 100644 index b7d3f82..0000000 --- a/schematic_hero_templ.go +++ /dev/null @@ -1,182 +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" - -// schematicHeroComponent renders the landing-page hero. -// UAT §13.6 requires the

to render in Space Grotesk at >= 64px on 1440x900. -// UAT §6 requires a scrim layer between the background image and the title text. -func schematicHeroComponent(data SchematicHeroData) 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.Image != "" { - 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, 4, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.Kicker != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(data.Kicker) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `schematic_hero.templ`, Line: 21, Col: 19} - } - _, 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, 6, "
") - 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.Title == "" { - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs("Untitled mission") - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `schematic_hero.templ`, Line: 29, Col: 26} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(data.Title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `schematic_hero.templ`, Line: 31, Col: 18} - } - _, 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 - } - if data.PrimaryCTA.Text != "" && data.PrimaryCTA.Href != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(data.PrimaryCTA.Text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `schematic_hero.templ`, Line: 40, Col: 29} - } - _, 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 - } - } - if data.SecondaryCTA.Text != "" && data.SecondaryCTA.Href != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var9 string - templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(data.SecondaryCTA.Text) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `schematic_hero.templ`, Line: 48, Col: 31} - } - _, 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, 14, "") - 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 - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/status_bar.go b/status_bar.go deleted file mode 100644 index 7999bbd..0000000 --- a/status_bar.go +++ /dev/null @@ -1,38 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// StatusBarBlockMeta defines metadata for the persistent status-bar rail. -var StatusBarBlockMeta = blocks.BlockMeta{ - Key: "status_bar", - Title: "Status Bar", - Description: "Persistent top rail with optional UTC clock, build hash, and callsign.", - Source: "scifi-clean", - Category: blocks.CategoryNavigation, -} - -// StatusBarData drives the templ render. -type StatusBarData struct { - ShowClock bool - ShowBuild bool - Callsign string -} - -// StatusBarBlock renders the persistent top rail. -// Content shape: {"showClock": true, "showBuild": true, "callsign": "SCF-CLN"} -func StatusBarBlock(ctx context.Context, content map[string]any) string { - data := StatusBarData{ - ShowClock: getBool(content, "showClock", true), - ShowBuild: getBool(content, "showBuild", true), - Callsign: getStringDefault(content, "callsign", "SCF-CLN"), - } - - var buf bytes.Buffer - _ = statusBarComponent(data).Render(ctx, &buf) - return buf.String() -} diff --git a/status_bar.templ b/status_bar.templ deleted file mode 100644 index b634723..0000000 --- a/status_bar.templ +++ /dev/null @@ -1,46 +0,0 @@ -package main - -// statusBarComponent renders the sticky top status rail. -// UAT §13.9 requires position: sticky and top: 0. -templ statusBarComponent(data StatusBarData) { -
-
-
- { data.Callsign } - | - PUBLIC -
-
- if data.ShowClock { - - { "00:00:00 UTC" } - - } - if data.ShowBuild { - | - BLD a1b2c3 - } -
-
- -
-} diff --git a/status_bar_templ.go b/status_bar_templ.go deleted file mode 100644 index be9b523..0000000 --- a/status_bar_templ.go +++ /dev/null @@ -1,84 +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" - -// statusBarComponent renders the sticky top status rail. -// UAT §13.9 requires position: sticky and top: 0. -func statusBarComponent(data StatusBarData) 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.Callsign) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `status_bar.templ`, Line: 13, Col: 55} - } - _, 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, " | PUBLIC
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if data.ShowClock { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs("00:00:00 UTC") - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `status_bar.templ`, Line: 23, Col: 22} - } - _, 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 - } - } - if data.ShowBuild { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "| BLD a1b2c3") - 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 - } - return nil - }) -} - -var _ = templruntime.GeneratedTemplate diff --git a/tech_spec.go b/tech_spec.go deleted file mode 100644 index fce5383..0000000 --- a/tech_spec.go +++ /dev/null @@ -1,50 +0,0 @@ -package main - -import ( - "bytes" - "context" - - "git.dev.alexdunmow.com/block/core/blocks" -) - -// TechSpecBlockMeta defines metadata for the tech-spec table block. -var TechSpecBlockMeta = blocks.BlockMeta{ - Key: "tech_spec", - Title: "Tech Spec Table", - Description: "Specification table with right-aligned mono numerals and hairline rows.", - Source: "scifi-clean", - Category: blocks.CategoryContent, -} - -// TechSpecRow is one label/value/unit triple. -type TechSpecRow struct { - Label string - Value string - Unit string -} - -// TechSpecData drives the templ render. -type TechSpecData struct { - Caption string - Rows []TechSpecRow -} - -// TechSpecBlock renders the tech-spec block. -// Content shape: {"caption": "...", "rows": [{"label": "...", "value": "...", "unit": "..."}]} -func TechSpecBlock(ctx context.Context, content map[string]any) string { - data := TechSpecData{ - Caption: getString(content, "caption"), - } - - for _, raw := range getSlice(content, "rows") { - data.Rows = append(data.Rows, TechSpecRow{ - Label: getString(raw, "label"), - Value: getString(raw, "value"), - Unit: getString(raw, "unit"), - }) - } - - var buf bytes.Buffer - _ = techSpecComponent(data).Render(ctx, &buf) - return buf.String() -} diff --git a/tech_spec.templ b/tech_spec.templ deleted file mode 100644 index 4af3ff5..0000000 --- a/tech_spec.templ +++ /dev/null @@ -1,53 +0,0 @@ -package main - -// techSpecComponent renders the tech-spec table with right-aligned mono numerals -// and hairline row rules. -templ techSpecComponent(data TechSpecData) { -
-
- if data.Caption != "" { -

- { data.Caption } -

- } - - - if len(data.Rows) == 0 { - - - - - - } else { - for i, row := range data.Rows { - @techSpecRow(row, i == len(data.Rows)-1) - } - } - -
No spec rows yet.--
-
-
-} - -// techSpecRow renders a single row. Last-row check controls whether to drop -// the bottom hairline. -templ techSpecRow(row TechSpecRow, last bool) { - - - { row.Label } - - - { row.Value } - - - { row.Unit } - - -} - -func rowBorderClass(last bool) string { - if last { - return "" - } - return "hairline-b" -} diff --git a/tech_spec_templ.go b/tech_spec_templ.go deleted file mode 100644 index fa42d59..0000000 --- a/tech_spec_templ.go +++ /dev/null @@ -1,177 +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" - -// techSpecComponent renders the tech-spec table with right-aligned mono numerals -// and hairline row rules. -func techSpecComponent(data TechSpecData) 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.Caption != "" { - 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(data.Caption) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `tech_spec.templ`, Line: 10, 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, 3, "

") - 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 - } - if len(data.Rows) == 0 { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - for i, row := range data.Rows { - templ_7745c5c3_Err = techSpecRow(row, i == len(data.Rows)-1).Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "
No spec rows yet.--
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// techSpecRow renders a single row. Last-row check controls whether to drop -// the bottom hairline. -func techSpecRow(row TechSpecRow, last bool) 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) - var templ_7745c5c3_Var4 = []any{rowBorderClass(last)} - 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, 7, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(row.Label) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `tech_spec.templ`, Line: 37, Col: 14} - } - _, 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 - } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(row.Value) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `tech_spec.templ`, Line: 40, Col: 14} - } - _, 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, 10, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(row.Unit) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `tech_spec.templ`, Line: 43, Col: 13} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) - 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 - }) -} - -func rowBorderClass(last bool) string { - if last { - return "" - } - return "hairline-b" -} - -var _ = templruntime.GeneratedTemplate diff --git a/template.templ b/template.templ deleted file mode 100644 index b10c0a6..0000000 --- a/template.templ +++ /dev/null @@ -1,281 +0,0 @@ -package main - -import ( - "context" - - "git.dev.alexdunmow.com/block/core/templates/bn" -) - -// PageData holds the values lifted out of the render `doc` map for the -// four Sci-Fi Clean page templates. -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 -} - -// parseScifiPageData lifts the well-known keys out of the inbound doc map. -// Unknown keys (e.g. block content) are ignored by the page renderers. -func parseScifiPageData(doc map[string]any) PageData { - title := "Untitled" - if t, ok := doc["title"].(string); ok { - title = t - } - - slots := make(map[string]string) - if s, ok := doc["slots"].(map[string]string); ok { - slots = s - } - - themeCSS := "" - if tc, ok := doc["theme_css"].(string); ok { - themeCSS = tc - } - - structuredData := "" - if sd, ok := doc["structured_data"].(string); ok { - structuredData = sd - } - - cssHash := "" - if ch, ok := doc["css_hash"].(string); ok { - cssHash = ch - } - - pageviewNonce := "" - if pn, ok := doc["pageview_nonce"].(string); ok { - pageviewNonce = pn - } - - themeMode := "light" - if tm, ok := doc["theme_mode"].(string); ok && tm != "" { - themeMode = tm - } - - siteSettings := bn.ParseSiteSettings(doc) - pageMeta := bn.ParsePageMeta(doc) - engagementConfig := bn.ParseEngagementConfig(doc) - - return PageData{ - Title: title, - Slots: slots, - ThemeMode: themeMode, - ThemeCSS: themeCSS, - SiteSettings: siteSettings, - PageMeta: pageMeta, - StructuredData: structuredData, - CSSHash: cssHash, - PageviewNonce: pageviewNonce, - EngagementConfig: engagementConfig, - } -} - -// htmlClassForMode returns the root class for the current theme mode. -func htmlClassForMode(mode string) string { - if mode == "dark" { - return "dark" - } - return "" -} - -// ===== Default template (header / main / footer) ===== - -templ ScifiClean(data PageData) { - - - @bn.Head(bn.HeadData{ - Title: data.Title, - Settings: data.SiteSettings, - PageMeta: data.PageMeta, - ThemeMode: data.ThemeMode, - ThemeCSS: data.ThemeCSS, - PluginStyles: []string{}, - StructuredData: data.StructuredData, - CSSHash: data.CSSHash, - PageviewNonce: data.PageviewNonce, - EngagementConfig: data.EngagementConfig, - }) - - @bn.AdminBypassBanner(data.SiteSettings) -
- @templ.Raw(data.Slots["header"]) -
-
- if main, ok := data.Slots["main"]; ok && main != "" { - @templ.Raw(main) - } else { -
- No content blocks assigned to this page. -
- } -
-
- @templ.Raw(data.Slots["footer"]) -
- @bn.BodyEnd(data.SiteSettings) - - -} - -// ===== Landing template (hero / specs / main / cta / footer) ===== - -templ ScifiCleanLanding(data PageData) { - - - @bn.Head(bn.HeadData{ - Title: data.Title, - Settings: data.SiteSettings, - PageMeta: data.PageMeta, - ThemeMode: data.ThemeMode, - ThemeCSS: data.ThemeCSS, - PluginStyles: []string{}, - StructuredData: data.StructuredData, - CSSHash: data.CSSHash, - PageviewNonce: data.PageviewNonce, - EngagementConfig: data.EngagementConfig, - }) - - @bn.AdminBypassBanner(data.SiteSettings) -
- @templ.Raw(data.Slots["hero"]) -
- if specs, ok := data.Slots["specs"]; ok && specs != "" { -
-
-
- @templ.Raw(specs) -
-
-
- } -
- if main, ok := data.Slots["main"]; ok && main != "" { -
- @templ.Raw(main) -
- } -
- if cta, ok := data.Slots["cta"]; ok && cta != "" { -
-
- @templ.Raw(cta) -
-
- } -
- @templ.Raw(data.Slots["footer"]) -
- @bn.BodyEnd(data.SiteSettings) - - -} - -// ===== Article template (header / rail / main / footer) ===== - -templ ScifiCleanArticle(data PageData) { - - - @bn.Head(bn.HeadData{ - Title: data.Title, - Settings: data.SiteSettings, - PageMeta: data.PageMeta, - ThemeMode: data.ThemeMode, - ThemeCSS: data.ThemeCSS, - PluginStyles: []string{}, - StructuredData: data.StructuredData, - CSSHash: data.CSSHash, - PageviewNonce: data.PageviewNonce, - EngagementConfig: data.EngagementConfig, - }) - - @bn.AdminBypassBanner(data.SiteSettings) -
- @templ.Raw(data.Slots["header"]) -
-
-
- if rail, ok := data.Slots["rail"]; ok && rail != "" { - - } -
- if main, ok := data.Slots["main"]; ok && main != "" { - @templ.Raw(main) - } else { -

No article body.

- } -
-
-
-
- @templ.Raw(data.Slots["footer"]) -
- @bn.BodyEnd(data.SiteSettings) - - -} - -// ===== Full-width template (header / main / footer) ===== - -templ ScifiCleanFullWidth(data PageData) { - - - @bn.Head(bn.HeadData{ - Title: data.Title, - Settings: data.SiteSettings, - PageMeta: data.PageMeta, - ThemeMode: data.ThemeMode, - ThemeCSS: data.ThemeCSS, - PluginStyles: []string{}, - StructuredData: data.StructuredData, - CSSHash: data.CSSHash, - PageviewNonce: data.PageviewNonce, - EngagementConfig: data.EngagementConfig, - }) - - @bn.AdminBypassBanner(data.SiteSettings) -
- @templ.Raw(data.Slots["header"]) -
-
- if main, ok := data.Slots["main"]; ok && main != "" { - @templ.Raw(main) - } else { -
- No content blocks assigned to this page. -
- } -
-
- @templ.Raw(data.Slots["footer"]) -
- @bn.BodyEnd(data.SiteSettings) - - -} - -// ===== Render entry points (adapted by wrap() in register.go) ===== - -func RenderScifiClean(ctx context.Context, doc map[string]any) templ.Component { - return ScifiClean(parseScifiPageData(doc)) -} - -func RenderScifiCleanLanding(ctx context.Context, doc map[string]any) templ.Component { - return ScifiCleanLanding(parseScifiPageData(doc)) -} - -func RenderScifiCleanArticle(ctx context.Context, doc map[string]any) templ.Component { - return ScifiCleanArticle(parseScifiPageData(doc)) -} - -func RenderScifiCleanFullWidth(ctx context.Context, doc map[string]any) templ.Component { - return ScifiCleanFullWidth(parseScifiPageData(doc)) -} diff --git a/template_templ.go b/template_templ.go deleted file mode 100644 index bd1da52..0000000 --- a/template_templ.go +++ /dev/null @@ -1,643 +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 holds the values lifted out of the render `doc` map for the -// four Sci-Fi Clean page templates. -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 -} - -// parseScifiPageData lifts the well-known keys out of the inbound doc map. -// Unknown keys (e.g. block content) are ignored by the page renderers. -func parseScifiPageData(doc map[string]any) PageData { - title := "Untitled" - if t, ok := doc["title"].(string); ok { - title = t - } - - slots := make(map[string]string) - if s, ok := doc["slots"].(map[string]string); ok { - slots = s - } - - themeCSS := "" - if tc, ok := doc["theme_css"].(string); ok { - themeCSS = tc - } - - structuredData := "" - if sd, ok := doc["structured_data"].(string); ok { - structuredData = sd - } - - cssHash := "" - if ch, ok := doc["css_hash"].(string); ok { - cssHash = ch - } - - pageviewNonce := "" - if pn, ok := doc["pageview_nonce"].(string); ok { - pageviewNonce = pn - } - - themeMode := "light" - if tm, ok := doc["theme_mode"].(string); ok && tm != "" { - themeMode = tm - } - - siteSettings := bn.ParseSiteSettings(doc) - pageMeta := bn.ParsePageMeta(doc) - engagementConfig := bn.ParseEngagementConfig(doc) - - return PageData{ - Title: title, - Slots: slots, - ThemeMode: themeMode, - ThemeCSS: themeCSS, - SiteSettings: siteSettings, - PageMeta: pageMeta, - StructuredData: structuredData, - CSSHash: cssHash, - PageviewNonce: pageviewNonce, - EngagementConfig: engagementConfig, - } -} - -// htmlClassForMode returns the root class for the current theme mode. -func htmlClassForMode(mode string) string { - if mode == "dark" { - return "dark" - } - return "" -} - -// ===== Default template (header / main / footer) ===== -func ScifiClean(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_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 = []any{htmlClassForMode(data.ThemeMode)} - 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, 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{}, - 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, 4, "") - 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
") - 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, 6, "
") - 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, 7, "
No content blocks assigned to this page.
") - 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 = 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, 9, "
") - 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, 10, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// ===== Landing template (hero / specs / main / cta / footer) ===== -func ScifiCleanLanding(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, 11, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 = []any{htmlClassForMode(data.ThemeMode)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var5...) - 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 = bn.Head(bn.HeadData{ - Title: data.Title, - Settings: data.SiteSettings, - PageMeta: data.PageMeta, - ThemeMode: data.ThemeMode, - ThemeCSS: data.ThemeCSS, - PluginStyles: []string{}, - 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, 14, "") - 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "
") - 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, 16, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if specs, ok := data.Slots["specs"]; ok && specs != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(specs).Render(ctx, templ_7745c5c3_Buffer) - 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 - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if main, ok := data.Slots["main"]; ok && main != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(main).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 = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if cta, ok := data.Slots["cta"]; ok && cta != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ.Raw(cta).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 = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "
") - 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, 26, "
") - 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, 27, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// ===== Article template (header / rail / main / footer) ===== -func ScifiCleanArticle(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_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var8 = []any{htmlClassForMode(data.ThemeMode)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var8...) - 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 - } - templ_7745c5c3_Err = bn.Head(bn.HeadData{ - Title: data.Title, - Settings: data.SiteSettings, - PageMeta: data.PageMeta, - ThemeMode: data.ThemeMode, - ThemeCSS: data.ThemeCSS, - PluginStyles: []string{}, - 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, 31, "") - 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "
") - 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, 33, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if rail, ok := data.Slots["rail"]; ok && rail != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "
") - 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, 37, "

No article body.

") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "
") - 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, 39, "
") - 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, 40, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// ===== Full-width template (header / main / footer) ===== -func ScifiCleanFullWidth(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_Var10 := templ.GetChildren(ctx) - if templ_7745c5c3_Var10 == nil { - templ_7745c5c3_Var10 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var11 = []any{htmlClassForMode(data.ThemeMode)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var11...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "") - 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{}, - 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, 44, "") - 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 = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "
") - 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, 46, "
") - 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, 47, "
No content blocks assigned to this page.
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "
") - 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, 49, "
") - 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, 50, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -// ===== Render entry points (adapted by wrap() in register.go) ===== - -func RenderScifiClean(ctx context.Context, doc map[string]any) templ.Component { - return ScifiClean(parseScifiPageData(doc)) -} - -func RenderScifiCleanLanding(ctx context.Context, doc map[string]any) templ.Component { - return ScifiCleanLanding(parseScifiPageData(doc)) -} - -func RenderScifiCleanArticle(ctx context.Context, doc map[string]any) templ.Component { - return ScifiCleanArticle(parseScifiPageData(doc)) -} - -func RenderScifiCleanFullWidth(ctx context.Context, doc map[string]any) templ.Component { - return ScifiCleanFullWidth(parseScifiPageData(doc)) -} - -var _ = templruntime.GeneratedTemplate diff --git a/templates/email/scifi-clean.ninjatpl b/templates/email/scifi-clean.ninjatpl new file mode 100644 index 0000000..16ed4ab --- /dev/null +++ b/templates/email/scifi-clean.ninjatpl @@ -0,0 +1,60 @@ + + + + + + + {{ site_name }} + + + + {% if preview_text %}
{{ preview_text }}
{% endif %} + + + + +
+ + + + + + + + + + + +
+ + diff --git a/templates/overrides/scifi-clean/button.ninjatpl b/templates/overrides/scifi-clean/button.ninjatpl new file mode 100644 index 0000000..232a31f --- /dev/null +++ b/templates/overrides/scifi-clean/button.ninjatpl @@ -0,0 +1 @@ +{% if text %}{{ text }} {% endif %} diff --git a/templates/overrides/scifi-clean/heading.ninjatpl b/templates/overrides/scifi-clean/heading.ninjatpl new file mode 100644 index 0000000..3149810 --- /dev/null +++ b/templates/overrides/scifi-clean/heading.ninjatpl @@ -0,0 +1 @@ +
{% if kicker %}
{{ kicker }}
{% endif %}{% if level|integer == 1 %}

{{ 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/scifi-clean/text.ninjatpl b/templates/overrides/scifi-clean/text.ninjatpl new file mode 100644 index 0000000..5e7adef --- /dev/null +++ b/templates/overrides/scifi-clean/text.ninjatpl @@ -0,0 +1 @@ +
{{ text|safe }}
diff --git a/templates/scifi-clean/article.ninjatpl b/templates/scifi-clean/article.ninjatpl new file mode 100644 index 0000000..0a8044a --- /dev/null +++ b/templates/scifi-clean/article.ninjatpl @@ -0,0 +1,18 @@ + + +{{ head_html|safe }} + + {{ admin_banner_html|safe }} +
{{ slots.header|safe }}
+
+
+ {% if slots.rail %}{% endif %} +
+ {% if slots.main %}{{ slots.main|safe }}{% else %}

No article body.

{% endif %} +
+
+
+
{{ slots.footer|safe }}
+ {{ body_end_html|safe }} + + diff --git a/templates/scifi-clean/default.ninjatpl b/templates/scifi-clean/default.ninjatpl new file mode 100644 index 0000000..b15adde --- /dev/null +++ b/templates/scifi-clean/default.ninjatpl @@ -0,0 +1,13 @@ + + +{{ 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/scifi-clean/full-width.ninjatpl b/templates/scifi-clean/full-width.ninjatpl new file mode 100644 index 0000000..fcfb97f --- /dev/null +++ b/templates/scifi-clean/full-width.ninjatpl @@ -0,0 +1,13 @@ + + +{{ 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/scifi-clean/landing.ninjatpl b/templates/scifi-clean/landing.ninjatpl new file mode 100644 index 0000000..69e8c49 --- /dev/null +++ b/templates/scifi-clean/landing.ninjatpl @@ -0,0 +1,15 @@ + + +{{ head_html|safe }} + + {{ admin_banner_html|safe }} +
{{ slots.hero|safe }}
+ {% if slots.specs %}
{{ slots.specs|safe }}
{% endif %} +
+ {% if slots.main %}
{{ slots.main|safe }}
{% endif %} +
+ {% if slots.cta %}
{{ slots.cta|safe }}
{% endif %} +
{{ slots.footer|safe }}
+ {{ body_end_html|safe }} + + diff --git a/text_override.go b/text_override.go deleted file mode 100644 index bff3dc7..0000000 --- a/text_override.go +++ /dev/null @@ -1,17 +0,0 @@ -package main - -import ( - "bytes" - "context" -) - -// ScifiTextBlock renders body text with Inter via the --font-body variable. -// Inline numerals retain a tabular-nums treatment via the scifi-text class. -func ScifiTextBlock(ctx context.Context, content map[string]any) string { - text := getString(content, "text") - class := getString(content, "class") - - var buf bytes.Buffer - _ = scifiTextComponent(text, class).Render(ctx, &buf) - return buf.String() -} diff --git a/text_override.templ b/text_override.templ deleted file mode 100644 index 2d0e799..0000000 --- a/text_override.templ +++ /dev/null @@ -1,8 +0,0 @@ -package main - -// scifiTextComponent renders Inter body copy with the tabular-nums numeral treatment. -templ scifiTextComponent(text, class string) { -
- @templ.Raw(text) -
-} diff --git a/text_override_templ.go b/text_override_templ.go deleted file mode 100644 index 5a95c1f..0000000 --- a/text_override_templ.go +++ /dev/null @@ -1,67 +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" - -// scifiTextComponent renders Inter body copy with the tabular-nums numeral treatment. -func scifiTextComponent(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{"scifi-body prose max-w-none text-foreground tabular-nums", 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