From 01d2a6fd806b7c5bb7354680ee7efea66da23e7d Mon Sep 17 00:00:00 2001 From: Yuto Nishida Date: Mon, 10 Aug 2026 18:19:19 -0700 Subject: [PATCH] [owl] Fix serve rendering dotted-path pages as directory listings serve treats any path whose last segment contains a dot (e.g. /rendered/.sops.yaml) as a file, so it shows a directory listing instead of the page's index.html -- breaking nearly every rendered/raw file page under the local dev server. The new serve.json sets renderSingle, so serve returns a directory's lone index.html, which is exactly what owl emits per page. Real static hosts resolve these URLs natively; this only patches the local serve helper in run-owl-for-general-development.sh. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_0112UhDj44J8KdzZdE4xQPKX --- experimental/owl/run-owl-for-general-development.sh | 6 +++++- experimental/owl/serve.json | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 experimental/owl/serve.json diff --git a/experimental/owl/run-owl-for-general-development.sh b/experimental/owl/run-owl-for-general-development.sh index bc996c2..b72fbdc 100755 --- a/experimental/owl/run-owl-for-general-development.sh +++ b/experimental/owl/run-owl-for-general-development.sh @@ -35,4 +35,8 @@ pages=$(find -L "$site" -name '*.html' | wc -l | tr -d ' ') echo echo "owl site for your working tree: $out_link -> $site ($pages pages)" echo "==> serving http://localhost:3000 (Ctrl-C to stop)" -exec nix shell nixpkgs#nodejs --command npx --yes serve "$site" +# `serve` treats a path whose last segment has a dot (e.g. /rendered/.sops.yaml) as a +# file, so it shows a directory listing instead of the page. serve.json's renderSingle +# makes it serve each page directory's lone index.html. Real static hosts resolve these +# URLs natively — this only patches the local `serve` helper. +exec nix shell nixpkgs#nodejs --command npx --yes serve "$site" -c "$here/serve.json" diff --git a/experimental/owl/serve.json b/experimental/owl/serve.json new file mode 100644 index 0000000..23c2ecf --- /dev/null +++ b/experimental/owl/serve.json @@ -0,0 +1,3 @@ +{ + "renderSingle": true +} -- 2.51.2