diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-01-25 11:09:25 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-01-25 11:09:25 -0400 |
commit | 0d8619a70f03d9be3e3930fbc499a5918ec88c62 (patch) | |
tree | 41c98fb3e3d71d3bf36195b7ef8719eff13da1b6 /src/write/build-modes/static-build.js | |
parent | 0be0f926421d0efb48d2eb9ac7591ef2a03e4f8e (diff) |
write: static-build: skip symlinks/copies for 'to' w/ origin
Maybe nothing else is needed to get static-build working with online media? Maybe?
Diffstat (limited to 'src/write/build-modes/static-build.js')
-rw-r--r-- | src/write/build-modes/static-build.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/write/build-modes/static-build.js b/src/write/build-modes/static-build.js index d40e1cb7..3d3c779b 100644 --- a/src/write/build-modes/static-build.js +++ b/src/write/build-modes/static-build.js @@ -27,6 +27,7 @@ import { } from '#cli'; import { + getOrigin, getPagePathname, getURLsFrom, getURLsFromRoot, @@ -436,12 +437,18 @@ async function writePage({ ].filter(Boolean)); } +function filterNoOrigin(route) { + return !getOrigin(route.to); +} + function writeWebRouteSymlinks({ outputPath, webRoutes, }) { const symlinkRoutes = - webRoutes.filter(route => route.statically === 'symlink'); + webRoutes + .filter(route => route.statically === 'symlink') + .filter(filterNoOrigin); const promises = symlinkRoutes.map(async route => { @@ -481,7 +488,9 @@ async function writeWebRouteCopies({ webRoutes, }) { const copyRoutes = - webRoutes.filter(route => route.statically === 'copy'); + webRoutes + .filter(route => route.statically === 'copy') + .filter(filterNoOrigin); const promises = copyRoutes.map(async route => { |