Skip to content

Commit cc86ae0

Browse files
committed
Fix txt files not being put into collections
1 parent 4f0736e commit cc86ae0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/staticbuild.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,15 @@ export default async function staticbuild(options: StaticBuildOptions) {
906906
collectCollectionDependencies(options.inputDirectory, fileContents, collectionNameToEntries, dependencies)
907907
inputDependencies.set(absoluteFilePath, dependencies)
908908

909+
const collectionEntry = getCollectionEntryFromPath(relativeFilePath)
910+
911+
const outputPath = collectionEntry
912+
? path.join(options.outputDirectory, collectionEntry.path, path.basename(absoluteFilePath))
913+
: path.join(options.outputDirectory, relativeFilePath)
914+
909915
outputFiles.set(fileID, {
910916
buffer: Buffer.from(html),
911-
outputPath: path.join(options.outputDirectory, relativeFilePath),
917+
outputPath,
912918
})
913919
break
914920
}

0 commit comments

Comments
 (0)