code wiki / (root) / nx_build_site.nx

nx_build_site.nx

buildroot/runtime/nx_build_site.nx

22971 B546 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind orphan librarytopic build
docsdependenciesstructsconstsfunctions

about

nx_build_site.nx -- bits-up site builder. Replaces nishi-pages/build/build.py (530 LOC Python) with NishiLang substrate. Per user *"no python nothing but nishi from bits up"*. Pipeline: 1. Read content/site.yaml -> NxYamlDoc site vars (lifted to site.*) 2. Read theme templates: layout.html, index.html, post.html, page.html 3. For each .md in content/posts/: nx_build_doc round-trip emit a post-summary HTML block (for the homepage posts list) write dist/posts/<slug>.html 4. For each .md in content/pages/: nx_build_doc round-trip with PAGE template write dist/pages/<slug>.html 5. Build the homepage: substitute site.* + posts_html (concatenated summaries) wrap with layout.html write dist/index.html What this v1 does NOT do (queued): - Dynamic directory walking (uses a hardcoded list of slugs) - dist/404.html generation - style.css copy to dist/assets/ - server/pages.nx route emit These are easy follow-ups that compose with what's here. Memory budget (one rendering pass): ~64K per .md scratch ~32K per template ~256K total site arena nx_safety_envelope: intended_use: sovereign substrate builder for nishi-pages sil_target: SIL2 evidence: bench/nx_build_site_smoke.nx renders a fixture tree end-to-end and asserts output bytes verdict: NOT_YET_EVALUATED -- pending smoke

dependencies 6 imports · 0 importers

nx_syscalls_x86_64.nx nx_yaml_subset.nx nx_frontmatter.nx nx_http_template.nx nx_md_render.nx nx_build_doc.nx nx_build_site.nx

imports: nx_syscalls_x86_64.nxnx_yaml_subset.nxnx_frontmatter.nxnx_http_template.nxnx_md_render.nxnx_build_doc.nx

imported by: nobody (leaf or entry point)

structs

none

consts

48const NX_BS_OK: i64 = 0
49const NX_BS_BAD_INPUT: i64 = 1
50const NX_BS_READ_FAIL: i64 = 2
51const NX_BS_WRITE_FAIL: i64 = 3
52const NX_BS_RENDER_FAIL: i64 = 4
53const NX_BS_PATH_TOO_LONG: i64 = 5
54const NX_BS_VERDICT_N: i64 = 6
58const NX_BS_PATH_CAP: i64 = 512
59const NX_BS_HTML_CAP: i64 = 65536 // 64K per rendered page

functions

63func _bs_bcopy(dst: *u8, dst_off: i64, dst_cap: i64,
77func nx_bs_join(out: *u8, out_cap: i64,
98func nx_bs_read_file(path: *u8, out_n: *i64) -> *u8
104func nx_bs_write_file(path: *u8, buf: *u8, n: i64) -> i64
121func nx_bs_render_doc(md_path: *u8,
208func nx_bs_load_theme(base_dir: *u8, base_n: i64,
244func nx_bs_load_site_yaml(base_dir: *u8, base_n: i64) -> *NxYamlDoc
263func nx_bs_render_one_post(base_dir: *u8, base_n: i64,
304func nx_bs_append_post_summary(out: *u8, out_off: i64, out_cap: i64,
355func nx_bs_load_post_yaml(base_dir: *u8, base_n: i64,
391func nx_bs_render_homepage(base_dir: *u8, base_n: i64,
465func nx_bs_render_404(base_dir: *u8, base_n: i64,
496func nx_bs_copy_style_css(base_dir: *u8, base_n: i64) -> i64
516func nx_bs_render_one_page(base_dir: *u8, base_n: i64,