code wiki / _hdl_build / nx_cms_seo_team.nx

nx_cms_seo_team.nx source

↩ module page · 30 lines · 2386 B

1// nx_cms_seo_team.nx -- the TEAM authoring the SEO META renderer core (W2, no Claude logic). This is 2// the SECOND independent use of emit12 TEMPLATE_TABLE (after _pe_blockr) -- proof the new emitter 3// shape generalizes. The table IS the head-tag vocabulary (Yoast-class, as DATA): each meta/link tag 4// is one single-slot ESCAPED template (raw=0 -- attribute-safe). Per-tag markup lives nowhere but the 5// table; adding a tag = adding a row. The admin composes these (with field fallbacks) into 6// {{seo_head_html}}. Engineer verifies the emitted byte-exact KATs (incl. attribute escaping + 7// unknown-kind refusal). 8import "nx_pattern_emit12.nx" 9import "nx_syscalls.nx" 10 11func cst_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 12 13func main() -> i64 { 14 let t: *i64 = sys_mmap(8*5*8) as *i64 15 var n: i64 = 0 16 // single-slot rows: mid passed as NULL(0) (an "" literal aliases the next literal on this lane) 17 t[n*5]=1; t[n*5+1]="<title>" as *u8 as i64; t[n*5+2]=0; t[n*5+3]="</title>" as *u8 as i64; t[n*5+4]=0; n=n+1 18 t[n*5]=2; t[n*5+1]="<meta name=\"description\" content=\"" as *u8 as i64; t[n*5+2]=0; t[n*5+3]="\">" as *u8 as i64; t[n*5+4]=0; n=n+1 19 t[n*5]=3; t[n*5+1]="<meta property=\"og:title\" content=\"" as *u8 as i64; t[n*5+2]=0; t[n*5+3]="\">" as *u8 as i64; t[n*5+4]=0; n=n+1 20 t[n*5]=4; t[n*5+1]="<meta property=\"og:description\" content=\"" as *u8 as i64; t[n*5+2]=0; t[n*5+3]="\">" as *u8 as i64; t[n*5+4]=0; n=n+1 21 t[n*5]=5; t[n*5+1]="<meta property=\"og:image\" content=\"" as *u8 as i64; t[n*5+2]=0; t[n*5+3]="\">" as *u8 as i64; t[n*5+4]=0; n=n+1 22 t[n*5]=6; t[n*5+1]="<link rel=\"canonical\" href=\"" as *u8 as i64; t[n*5+2]=0; t[n*5+3]="\">" as *u8 as i64; t[n*5+4]=0; n=n+1 23 t[n*5]=7; t[n*5+1]="<meta property=\"og:type\" content=\"" as *u8 as i64; t[n*5+2]=0; t[n*5+3]="\">" as *u8 as i64; t[n*5+4]=0; n=n+1 24 let a: i64 = pe12_author_template_table("_pe_seohead" as *u8, 25 "runtime/_hdl_build/_pe_seohead.nx" as *u8, 26 "runtime/_hdl_build/_pe_seohead_test.nx" as *u8, t, n) 27 if a == 1 { cst_w("TEAM AUTHORED CORE: _pe_seohead (TEMPLATE_TABLE SEO head tags, 7 kinds + refuse) -- verify with Engineer\n" as *u8); sys_exit(0) } 28 cst_w("author failed\n" as *u8); sys_exit(1) 29 return 1 30}