code wiki / (root) / robots_txt.nx

robots_txt.nx

buildroot/runtime/robots_txt.nx

5574 B174 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic robots
docsdependenciesstructsconstsfunctions

about

robots_txt.nx -- build robots.txt files. Robots Exclusion Protocol (RFC 9309 -- finally standardised 2022 after 30 years of informal use). Served at /robots.txt at the site root; crawlers fetch it before any other URL on the site. Format: # comments User-agent: * Disallow: /private Disallow: /admin Allow: /private/public-page User-agent: Googlebot Disallow: /experimental Sitemap: https://example.com/sitemap.xml Groups: lines grouped under User-agent headers apply only to that agent. "*" matches everything without a dedicated group. Sitemap lines are global and can appear anywhere. Use cases: nishi-pages emits this at /robots.txt pointing at sitemap.xml and blocking /admin. Every site that wants to appear (or NOT appear) in search results needs it. Invariants: RT1 Output is plain ASCII; no escaping (robots.txt doesn't have a concept of encoding). RT2 Path values are literals -- caller is responsible for URL-encoding special characters if needed (rare). RT3 Stream builder: robots_agent -> robots_disallow* / robots_allow*, then robots_sitemap for global links.

dependencies 1 imports · 0 importers

syscalls.nx robots_txt.nx

imports: syscalls.nx

imported by: nobody (leaf or entry point)

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

main robots_comment rt_put robots_agent rt_put ↻ robots_disallow rt_put ↻ robots_allow rt_put ↻ robots_crawl_delay rt_put ↻ robots_blank rt_put ↻ robots_sitemap rt_put ↻

structs

none

consts

37const RT_ERR_SHORT: i64 = -1

functions

39func rt_put(out: *u8, cap: i64, off: i64, src: *u8, n: i64) -> i64 {
50func robots_comment(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: rt_put
62func robots_agent(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: rt_put
74func robots_disallow(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: rt_put
87func robots_allow(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: rt_put
99func robots_sitemap(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: rt_put
112func robots_crawl_delay(out: *u8, cap: i64, off: i64,
called by 1: main calls 1: rt_put
143func robots_blank(out: *u8, cap: i64, off: i64) -> i64 {
called by 1: main calls 1: rt_put
148func main() -> i64 {