code wiki / _hdl_build / nx_site_build.nx
nx_site_build.nx
buildroot/runtime/_hdl_build/nx_site_build.nx
about
nx_site_build.nx -- R1 WHOLE-SITE emitter. From ONE .site blueprint, emit a multi-PAGE site with a SHARED
cross-page nav, INTERNAL links between pages, and its own sitemap.xml + robots.txt -- all through the gorgeous
S-class kit (nx_sclass_kit sk_*), so every page is s-class-by-construction. Closes the whole-site gaps the
factory census named: shared nav, internal <a href> links, and wired sitemap/robots EMISSION over our output.
Reuses the andelinwest .site blueprint verbatim (title|/header|brand|cta|href /hero|headline|sub|cta|href
/search|action|placeholder /cards+card|title|body /steps+step| /trust+sig| /footer|): the page LIST is derived
from the cards (like nx_site_pages), but upgraded to the premium kit + real navigation + a self-emitted sitemap.
usage: nx_site_build <config.site> <docroot> <domain> [theme:0|1]
emits: <docroot>/index.html + <docroot>/practice/<slug>.html (one per card) + sitemap.xml + robots.txt
SCALE: one buffer is mmap'd ONCE and reused per page (no per-iteration mmap -> no bump-allocator starvation).
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_sclass_kit.nxnx_syscalls.nx
imported by: nx_siteedit_daemon.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 14 | const SB_MAGIC_1024: i64 = 1024 |
| 15 | const SB_MAGIC_131072: i64 = 131072 |
| 16 | const SB_MAGIC_262144: i64 = 262144 |
| 18 | const SB_ICON: *u8 = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 3l8 4v5c0 4-3.5 7-8 9-4.5-2-8-5-8-9V7l8-4z\"/></svg>" |
functions
| 20 | func sb_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 21 | func sb_wn(v: i64) -> i64 |
| 30 | func sb_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: sb_cg |
| 31 | func sb_cat(out: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){out[o]=s[i]; o=o+1; i=i+1} return o } |
| 34 | func sb_copy(arena: *u8, ap: i64, text: *u8, start: i64, end: i64) -> i64 |
| 42 | func sb_lm(text: *u8, ls: i64, le: i64, key: *u8, klen: i64) -> i64 |
| 50 | func sb_cg(text: *u8, tn: i64, key: *u8, out: *u8, cap: i64) -> i64 |
| 74 | func sb_fld(val: *u8, idx: i64, out: *u8) -> i64 called by 1: sb_build_site |
| 84 | func sb_slug(title: *u8, out: *u8) -> i64 called by 1: sb_cards |
| 103 | func sb_cards(text: *u8, tn: i64, ct: *i64, cb: *i64, cs: *i64, arena: *u8, apP: *i64, maxc: i64) -> i64 |
| 132 | func sb_single(text: *u8, tn: i64, key: *u8, klen: i64, ptrs: *i64, arena: *u8, apP: *i64, maxc: i64) -> i64 |
| 155 | func sb_phref(out: *u8, slug: *u8) -> i64 |
| 162 | func emit_nav(buf: *u8, off: i64, ncards: i64, ct: *i64, cs: *i64, hrefbuf: *u8) -> i64 |
| 173 | func emit_trust(buf: *u8, off: i64, nsigs: i64, sigs: *i64) -> i64 |
| 185 | func sb_build_site(config: *u8, docroot: *u8, domain: *u8, theme: i64) -> i64 |
| 308 | func main(argc: i64, argv: *i64) -> i64 |