code wiki / _hdl_build / nx_sitegen.nx
nx_sitegen.nx
buildroot/runtime/_hdl_build/nx_sitegen.nx
about
nx_sitegen.nx -- THE AUTO-BUILDER ENGINE: build a whole site page from a DECLARATIVE BLUEPRINT (data),
deterministically, with NO AI and NO hand-written HTML. A blueprint is an ordered array of typed BLOCKS;
the engine walks them in order and dispatches each to the sovereign nx_web_builder emitter for that kind.
Because the blueprint is pure DATA:
(1) a site is portable / diffable / versionable and NOT trapped in a proprietary editor (Wix/Webflow
exceed angle -- their layout lives in a closed cloud store; ours is data the operator owns),
(2) the Nishi team can REBUILD or UPDATE a site with no human and no model in the loop (autonomy),
(3) a local LLM is OPTIONAL -- its ONLY job is to emit a blueprint; the build + serve path stay
deterministic + sovereign whether the blueprint came from a human, the team, or a model.
The engine REFUSES (emits nothing, returns -1) any blueprint that is not UX-compliant by construction
(wb_ux_compliant: a clear CTA + onsite search + trust signals + <=3 resolution steps + responsive) --
a guarantee the Wix/WordPress "anything-goes canvas" does NOT make. Block kinds map 1:1 to nx_web_builder
emitters; new site types (game-publish, video-gallery) add new kinds WITHOUT touching the spine
(extensible; unknown kinds are skipped gracefully = forward-compatible). Composes nx_web_builder.
license_tier: ORIGINAL
dependencies 3 imports · 7 importers
imports: nx_web_builder.nxnx_html_sanitize.nxnx_syscalls.nx
imported by: nx_site_compose.nxnx_sitegen_exceed_gate.nxnx_sitegen_file_gate.nxnx_sitegen_gate.nxnx_sitegen_llm_gate.nxnx_sitegen_parse.nxnx_sitegen_studio.nx
structs
| none |
consts
| 21 | const SG_HEADER: i64 = 1 // a=brand b=cta_label c=cta_href |
| 22 | const SG_HERO: i64 = 2 // a=headline b=sub c=cta_label d=cta_href |
| 23 | const SG_SEARCH: i64 = 3 // a=action b=placeholder |
| 24 | const SG_CARDS: i64 = 4 // a=heading list=[title0,body0,title1,body1,...] lcount=#cards |
| 25 | const SG_STEPS: i64 = 5 // a=heading list=[label0,label1,...] lcount=#steps (<=3) |
| 26 | const SG_TRUST: i64 = 6 // list=[sig0,sig1,...] lcount=#signals |
| 27 | const SG_FOOTER: i64 = 7 // a=text |
| 28 | const SG_FAQ: i64 = 8 // a=heading list=[q0,a0,q1,a1,...] lcount=#qa pairs (additive content) |
| 29 | const SG_GALLERY: i64 = 9 // a=heading list=[src0,alt0,...] lcount=#images (additive content) |
| 30 | const SG_CTA: i64 = 10 // a=heading b=sub c=label d=href (mid-page call-to-action banner) |
functions
| 33 | func sg_compliant(kind: *i64, b: *i64, c: *i64, lcount: *i64, n: i64) -> i64 |
| 52 | func sg_grade(kind: *i64, b: *i64, c: *i64, lcount: *i64, n: i64) -> i64 |
| 73 | func sg_esc(src: *u8) -> *u8 |
| 89 | func sg_build_page(fd: i64, title: *u8, kind: *i64, a: *i64, b: *i64, c: *i64, d: *i64, list: *i64, lcount: *i64, n: i64) -> i64 called by 7: compose_buildxe_buildf_parse_buildmainmainl_build+1 calls 22: sg_compliantwb_doc_opensg_escwb_headerwb_herowb_search+16 |