sx-http: load sxc/ components (~docs/page), auto-detect Docker paths

Load sx/sxc/ directory for core layout components like ~docs/page,
~docs/section, ~docs/code. Auto-detect Docker (/app/sxc) vs dev
(/project/sx/sxc) paths with SX_SXC_DIR env override.

Fixes pages that use ~docs/page — all content pages now render
correctly with full component expansion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-28 17:26:25 +00:00
parent 2ae42d3898
commit c794e33dda

View File

@@ -1744,6 +1744,12 @@ let http_mode port =
in
load_dir lib_base;
load_dir shared_sx;
(* sxc/ has core layout components like ~docs/page *)
let sx_sxc = try Sys.getenv "SX_SXC_DIR" with Not_found ->
let docker_path = project_dir ^ "/sxc" in
let dev_path = project_dir ^ "/sx/sxc" in
if Sys.file_exists docker_path then docker_path else dev_path in
load_dir sx_sxc;
load_dir sx_sx;
let t1 = Unix.gettimeofday () in
Printf.eprintf "[sx-http] All files loaded in %.3fs\n%!" (t1 -. t0);