fix(server): add comment explaining single-locale /zh fallback logic

This commit is contained in:
sakuradairong
2026-06-19 02:23:10 +08:00
parent bb6c3043f2
commit 21e4ceb11f

View File

@@ -99,7 +99,9 @@ function resolvePath(url) {
// Try path/index.html // Try path/index.html
const asDirIndex = safePath(p + '/index.html'); const asDirIndex = safePath(p + '/index.html');
if (asDirIndex && isFile(asDirIndex)) return asDirIndex; if (asDirIndex && isFile(asDirIndex)) return asDirIndex;
// Try /zh prefix (next-intl locale) // Single-locale build: the static export places pages under /zh/.
// Fall back to /zh so that paths like /networks still resolve when the
// user navigates directly to a non-prefixed URL.
if (!p.startsWith('/zh')) { if (!p.startsWith('/zh')) {
const zh = safePath('/zh' + p); const zh = safePath('/zh' + p);
if (zh && isFile(zh)) return zh; if (zh && isFile(zh)) return zh;