From b357037a9062d6ef6bd7034f8f9d5b03fec775de Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 30 Nov 2025 01:59:41 +0900 Subject: refactor(nuldoc): Do not copy unused files --- services/nuldoc/nuldoc-src/commands/build.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'services/nuldoc/nuldoc-src/commands/build.ts') diff --git a/services/nuldoc/nuldoc-src/commands/build.ts b/services/nuldoc/nuldoc-src/commands/build.ts index 2a9295d..6185381 100644 --- a/services/nuldoc/nuldoc-src/commands/build.ts +++ b/services/nuldoc/nuldoc-src/commands/build.ts @@ -227,19 +227,19 @@ function collectTags(taggedPages: TaggedPage[]): [string, TaggedPage[]][] { } async function copyStaticFiles(config: Config) { + const staticDir = join(Deno.cwd(), config.locations.staticDir); + for (const site of Object.keys(config.sites)) { - const globPattern = joinGlobs([ - Deno.cwd(), - config.locations.staticDir, - "*", - ]); - for await (const entry of expandGlob(globPattern)) { - const src = entry.path; - const dst = src.replace( - config.locations.staticDir, - join(config.locations.destDir, site), - ); - await Deno.copyFile(src, dst); + const destDir = join(Deno.cwd(), config.locations.destDir, site); + + // Copy files from static/_all/ to all sites + for await (const entry of expandGlob(join(staticDir, "_all", "*"))) { + await Deno.copyFile(entry.path, join(destDir, entry.name)); + } + + // Copy files from static// to the corresponding site + for await (const entry of expandGlob(join(staticDir, site, "*"))) { + await Deno.copyFile(entry.path, join(destDir, entry.name)); } } } -- cgit v1.2.3-70-g09d2