From 34c4703043805419c2ce15d1f433b353525985de Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Jul 2026 14:23:34 +0000 Subject: [PATCH] Fix mixed-content livereload leak and Jekyll asset exclusion in static export - set NODE_ENV=production when booting the server for crawling, so the dev-only livereload script (injected by OLSKExpress whenever NODE_ENV !== production) doesn't get baked into the static pages and trip mixed-content blocking once served over HTTPS - write an empty .nojekyll to the export root; GitHub Pages otherwise treats underscore-prefixed folders (_shared, __compiled) as Jekyll-reserved and silently excludes them, 404ing every asset under them despite the generated HTML referencing the correct paths Found by testing the live deploy from #1 at hyperdraft.pondersource.com. --- static-export.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/static-export.js b/static-export.js index 391f6958..6c08b7fb 100644 --- a/static-export.js +++ b/static-export.js @@ -122,6 +122,11 @@ const OLSKStaticExportCopyBuiltAssets = function () { fs.cpSync(path.join(kRootDirectory, 'os-app'), kOutputDirectory, { recursive: true, }); + + // Without this, GitHub Pages treats folders like `_shared` and + // `__compiled` as Jekyll-reserved and silently excludes them from + // serving, 404ing every asset underneath. + fs.writeFileSync(path.join(kOutputDirectory, '.nojekyll'), ''); }; const OLSKStaticExportMain = async function () { @@ -140,7 +145,11 @@ const OLSKStaticExportMain = async function () { const server = spawn('npm', ['start'], { cwd: kRootDirectory, - env: Object.assign({}, process.env, { PORT: kPort }), + // NODE_ENV=production disables the dev-only livereload script + // (OLSKExpress/main.js), which would otherwise get baked into + // every crawled page and trip mixed-content blocking once served + // over HTTPS. + env: Object.assign({}, process.env, { PORT: kPort, NODE_ENV: 'production' }), stdio: 'inherit', detached: true, });