code wiki / _hdl_build / nx_meet_jobs.nx
nx_meet_jobs.nx source
↩ module page · 141 lines · 8231 B
1// nx_meet_jobs.nx -- R2 (+P1 nav/clean-URLs): emit the sovereign ZERO-JS OPENINGS BOARD + a detail page per
2// opening into web_assets/site_<slug>/ as jobs.html + job-<id>.html, with the shared header nav and clean links.
3// Openings come from a HAND-EDITABLE web_assets/meet_<slug>.openings (open|id|title|sector|location|type|summary);
4// all DATA values HTML-escaped. Brand reused from meet_<slug>.meet. license_tier: ORIGINAL
5// run: /tmp/nx_meet_jobs.sov.elf <slug> out: web_assets/site_<slug>/jobs.html + job-<id>.html
6import "nx_syscalls.nx"
7import "nx_meet_lib.nx"
8import "nx_web_builder.nx"
9import "nx_brand_tokens.nx"
10const K_MAGIC_1024: i64 = 1024
11const K_MAGIC_2048: i64 = 2048
12const K_MAGIC_4096: i64 = 4096
13
14func jobs_default() -> *u8 {
15 return "open|swe-001|Senior Software Engineer|Software / Engineering|McKinney, TX (hybrid)|Full-time|Build sovereign systems with a vetted local team. Real work samples reviewed -- no AI-slop applications.\nopen|rn-002|Registered Nurse (ICU)|Healthcare|Plano, TX (on-site)|Full-time|Day/night rotations at a partner hospital. TX RN license required. Verified employer, real posting.\nopen|cnc-003|CNC Machinist|Skilled Trades / Manufacturing|McKinney, TX (on-site)|Contract-to-hire|Precision parts, 3+ yrs on 5-axis. Local shop, verified.\nopen|acct-004|Staff Accountant|Finance / Accounting|Frisco, TX (hybrid)|Full-time|GL, month-end close, CPA track. Real growth, verified employer.\nopen|ae-005|Account Executive|Sales|Dallas metro (remote-flex)|Full-time|B2B pipeline that is actually warm. Realistic OTE, no ghost quotas.\n" as *u8
16}
17
18func main(argc: i64, argv: *i64) -> i64 {
19 let slug: *u8 = sys_mmap(64)
20 if argc >= 2 { meet_slug_safe(argv[1] as *u8, slug, 64) } else { meet_slug_safe("demo" as *u8, slug, 64) }
21
22 // ---- brand config ----
23 let cpath: *u8 = sys_mmap(256)
24 var o: i64 = mcat(cpath, 0, "web_assets/meet_" as *u8); o = mcat(cpath, o, slug); o = mcat(cpath, o, ".meet" as *u8)
25 let clp: *i64 = sys_mmap(16) as *i64; clp[0] = 0
26 var cdata: *u8 = sys_read_file(cpath, clp)
27 var cn: i64 = clp[0]
28 if (cdata as i64) == 0 { cn = 0 }
29 let brand: *u8 = sys_mmap(512)
30 meet_get_or(cdata, cn, "brand" as *u8, brand, 512, "Community Meet" as *u8)
31 let region: *u8 = sys_mmap(256)
32 meet_get_or(cdata, cn, "region" as *u8, region, 256, "the Dallas metro" as *u8)
33 let zip: *u8 = sys_mmap(32)
34 meet_get_or(cdata, cn, "zip" as *u8, zip, 32, "75071" as *u8)
35 let ebrand: *u8 = sys_mmap(K_MAGIC_1024); mesc(ebrand, 0, brand)
36 let eregion: *u8 = sys_mmap(512); mesc(eregion, 0, region)
37 let ezip: *u8 = sys_mmap(64); mesc(ezip, 0, zip)
38
39 // ---- openings (seed default if absent) ----
40 let opath: *u8 = sys_mmap(256)
41 o = mcat(opath, 0, "web_assets/meet_" as *u8); o = mcat(opath, o, slug); o = mcat(opath, o, ".openings" as *u8)
42 let olp: *i64 = sys_mmap(16) as *i64; olp[0] = 0
43 var odata: *u8 = sys_read_file(opath, olp)
44 var on: i64 = olp[0]
45 if (odata as i64) == 0 { on = 0 }
46 if on <= 0 {
47 let od: *u8 = jobs_default()
48 let ofd: i64 = sys_openat_wr(opath, 0x1a4)
49 if ofd >= 0 { sys_write(ofd, od, mlen(od)); sys_close(ofd) }
50 odata = od; on = mlen(od)
51 }
52
53 // ---- per-site dir + clean paths ----
54 let sdir: *u8 = sys_mmap(256)
55 o = mcat(sdir, 0, "web_assets/site_" as *u8); o = mcat(sdir, o, slug); meet_mkdir(sdir)
56 let bpath: *u8 = sys_mmap(256)
57 o = mcat(bpath, 0, sdir); o = mcat(bpath, o, "/jobs.html" as *u8)
58 let foot: *u8 = sys_mmap(K_MAGIC_1024)
59 var ff: i64 = mcat(foot, 0, ebrand); ff = mcat(foot, ff, " -- " as *u8); ff = mcat(foot, ff, eregion)
60 ff = mcat(foot, ff, " (" as *u8); ff = mcat(foot, ff, ezip); ff = mcat(foot, ff, ") -- a Nishi sovereign community" as *u8)
61 let hsub: *u8 = sys_mmap(K_MAGIC_1024)
62 var hh: i64 = mcat(hsub, 0, "Verified employers, real openings -- " as *u8); hh = mcat(hsub, hh, eregion); hh = mcat(hsub, hh, ". No ghost jobs." as *u8)
63 let btitle: *u8 = sys_mmap(K_MAGIC_1024)
64 var bt: i64 = mcat(btitle, 0, ebrand); bt = mcat(btitle, bt, " -- Open roles" as *u8)
65 let brandtok: *u8 = bt_default_brand()
66
67 let fd: i64 = sys_openat_wr(bpath, 0x1a4)
68 if fd < 0 { mputs("nx_meet_jobs: FAIL open board\n" as *u8); sys_exit(1); return 1 }
69 wb_doc_open_branded(fd, btitle, brandtok, bt_len(brandtok))
70 meet_nav_css(fd)
71 meet_header_nav(fd, brand, 1)
72 wb_hero(fd, "Open roles" as *u8, hsub, "Post a role" as *u8, "hire.html" as *u8)
73 wb_search(fd, "jobs.html" as *u8, "Filter by title, sector, or location..." as *u8)
74 wb_cards_open(fd, "Open roles" as *u8)
75
76 let rawb: *u8 = sys_mmap(K_MAGIC_2048)
77 let idsafe: *u8 = sys_mmap(64)
78 let etitle: *u8 = sys_mmap(K_MAGIC_1024)
79 let esec: *u8 = sys_mmap(K_MAGIC_1024)
80 let eloc: *u8 = sys_mmap(K_MAGIC_1024)
81 let etype: *u8 = sys_mmap(512)
82 let esum: *u8 = sys_mmap(K_MAGIC_4096)
83 let dpath: *u8 = sys_mmap(256)
84 let dhref: *u8 = sys_mmap(256)
85
86 var count: i64 = 0
87 var i: i64 = 0
88 while i < on {
89 var le: i64 = i
90 while le < on { if odata[le] == (10 as u8) { break } le = le + 1 }
91 var p0: i64 = 0 - 1
92 var k: i64 = i
93 while k < le { if odata[k] == (124 as u8) { if p0 < 0 { p0 = k } } k = k + 1 }
94 if p0 >= 0 {
95 if meet_seq(odata, i, p0, "open" as *u8, 4) == 1 {
96 mfield(odata, i, le, 1, rawb, K_MAGIC_2048); meet_slug_safe(rawb, idsafe, 64)
97 mfield(odata, i, le, 2, rawb, K_MAGIC_2048); mesc(etitle, 0, rawb)
98 mfield(odata, i, le, 3, rawb, K_MAGIC_2048); mesc(esec, 0, rawb)
99 mfield(odata, i, le, 4, rawb, K_MAGIC_2048); mesc(eloc, 0, rawb)
100 mfield(odata, i, le, 5, rawb, K_MAGIC_2048); mesc(etype, 0, rawb)
101 mfield(odata, i, le, 6, rawb, K_MAGIC_2048); mesc(esum, 0, rawb)
102 var dp: i64 = mcat(dpath, 0, sdir); dp = mcat(dpath, dp, "/job-" as *u8); dp = mcat(dpath, dp, idsafe); dp = mcat(dpath, dp, ".html" as *u8)
103 var dh: i64 = mcat(dhref, 0, "job-" as *u8); dh = mcat(dhref, dh, idsafe); dh = mcat(dhref, dh, ".html" as *u8)
104
105 wb_w(fd, "<div class=\"card\"><h3>" as *u8); wb_w(fd, etitle); wb_w(fd, "</h3><p>" as *u8)
106 wb_w(fd, esec); wb_w(fd, " · " as *u8); wb_w(fd, eloc); wb_w(fd, " · " as *u8); wb_w(fd, etype)
107 wb_w(fd, "</p><p>" as *u8); wb_w(fd, esum); wb_w(fd, "</p><a class=\"cta\" href=\"" as *u8); wb_w(fd, dhref); wb_w(fd, "\">View role</a></div>\n" as *u8)
108
109 let dfd: i64 = sys_openat_wr(dpath, 0x1a4)
110 if dfd >= 0 {
111 wb_doc_open_branded(dfd, etitle, brandtok, bt_len(brandtok))
112 meet_nav_css(dfd)
113 meet_header_nav(dfd, brand, 1)
114 wb_w(dfd, "<section class=\"wrap\"><p><a href=\"jobs.html\">Back to all roles</a></p><h1>" as *u8); wb_w(dfd, etitle); wb_w(dfd, "</h1>" as *u8)
115 wb_w(dfd, "<p><b>" as *u8); wb_w(dfd, esec); wb_w(dfd, "</b> · " as *u8); wb_w(dfd, eloc); wb_w(dfd, " · " as *u8); wb_w(dfd, etype); wb_w(dfd, "</p>" as *u8)
116 wb_w(dfd, "<p>" as *u8); wb_w(dfd, esum); wb_w(dfd, "</p>" as *u8)
117 wb_w(dfd, "<p><a class=\"cta\" href=\"apply.html\">Apply for this role</a></p></section>\n" as *u8)
118 wb_footer(dfd, foot)
119 wb_doc_close(dfd)
120 sys_close(dfd)
121 }
122 count = count + 1
123 }
124 }
125 i = le + 1
126 }
127
128 wb_cards_close(fd)
129 let trust: *i64 = sys_mmap(64) as *i64
130 trust[0] = "Every employer verified -- no ghost jobs" as *u8 as i64
131 trust[1] = "Real postings, checked for authenticity" as *u8 as i64
132 trust[2] = "Local-first, then expanding out" as *u8 as i64
133 wb_trust(fd, trust, 3)
134 wb_footer(fd, foot)
135 wb_doc_close(fd)
136 sys_close(fd)
137
138 mputs("nx_meet_jobs: slug=" as *u8); mputs(slug); mputs(" -> " as *u8); mputs(bpath); mputs(" openings=" as *u8); mnum(count); mputs(" (+" as *u8); mnum(count); mputs(" detail pages, nav, 0 JS, escaped)\n" as *u8)
139 sys_exit(0)
140 return 0
141}