code wiki / _hdl_build / nx_site_build.nx

nx_site_build.nx

buildroot/runtime/_hdl_build/nx_site_build.nx

27226 B531 linesdepth 4pulls 5 transitivereach 2 importersview sourcekind tooltopic site
docsdependenciesstructsconstsfunctions

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 3 imports · 1 importers

nx_sclass_kit.nx nx_nishi_editorial.nx nx_syscalls.nx nx_site_build.nx nx_siteedit_daemon.nx

imports: nx_sclass_kit.nxnx_nishi_editorial.nxnx_syscalls.nx

imported by: nx_siteedit_daemon.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sb_w sys_write sys_exit sb_build_site sys_mmap nxa_die sys_write ↻ sys_exit ↻ nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close sb_w ↻ sb_cg sb_slen sb_lm sb_fld sb_cards sb_lm ↻ sb_copy sb_slug sb_single sb_lm ↻ sb_copy ↻ sys_mkdir

structs

none

consts

15const SB_MAGIC_1024: i64 = 1024
16const SB_MAGIC_131072: i64 = 131072
17const SB_MAGIC_262144: i64 = 262144
19const 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

21func 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 }
called by 2: sb_build_sitemain calls 1: sys_write
22func sb_wn(v: i64) -> i64
called by 1: sb_build_site calls 2: sys_writesys_mmap
31func 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
32func 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 }
35func sb_copy(arena: *u8, ap: i64, text: *u8, start: i64, end: i64) -> i64
called by 2: sb_cardssb_single
43func sb_lm(text: *u8, ls: i64, le: i64, key: *u8, klen: i64) -> i64
51func sb_cg(text: *u8, tn: i64, key: *u8, out: *u8, cap: i64) -> i64
called by 1: sb_build_site calls 2: sb_slensb_lm
75func sb_fld(val: *u8, idx: i64, out: *u8) -> i64
called by 1: sb_build_site
85func sb_slug(title: *u8, out: *u8) -> i64
called by 1: sb_cards
104func sb_cards(text: *u8, tn: i64, ct: *i64, cb: *i64, cs: *i64, arena: *u8, apP: *i64, maxc: i64) -> i64
called by 1: sb_build_site calls 3: sb_lmsb_copysb_slug
133func sb_single(text: *u8, tn: i64, key: *u8, klen: i64, ptrs: *i64, arena: *u8, apP: *i64, maxc: i64) -> i64
called by 1: sb_build_site calls 2: sb_lmsb_copy
156func sb_phref(out: *u8, slug: *u8) -> i64
163func emit_nav(buf: *u8, off: i64, ncards: i64, ct: *i64, cs: *i64, hrefbuf: *u8) -> i64
called by 1: sb_build_site calls 2: sk_nav_itemsb_phref
174func emit_trust(buf: *u8, off: i64, nsigs: i64, sigs: *i64) -> i64
185func sb_emit_sitemap_robots(buf: *u8, pathbuf: *u8, docroot: *u8, domain: *u8, ncards: i64, cs: *i64) -> i64
206func sb_ed_nav(buf: *u8, off: i64, brand: *u8, ncards: i64, ct: *i64, cs: *i64, hrefbuf: *u8, cur: i64) -> i64
226func sb_build_site(config: *u8, docroot: *u8, domain: *u8, theme: i64) -> i64
518func main(argc: i64, argv: *i64) -> i64