From 2c59dfdae305ab12028e59b0500614b397493763 Mon Sep 17 00:00:00 2001 From: Timothy Lin Date: Sat, 27 Apr 2024 22:56:30 +0800 Subject: [PATCH] revert file url --- .../source-files/src/fetchData/mapping/field-image.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/@contentlayer/source-files/src/fetchData/mapping/field-image.ts b/packages/@contentlayer/source-files/src/fetchData/mapping/field-image.ts index 6468728f..33600922 100644 --- a/packages/@contentlayer/source-files/src/fetchData/mapping/field-image.ts +++ b/packages/@contentlayer/source-files/src/fetchData/mapping/field-image.ts @@ -57,9 +57,8 @@ const getImageFieldData = ({ const documentDirPath = utils.dirname(documentFilePath) const filePath = utils.filePathJoin(documentDirPath, imagePath) - const absoluteFilePath = URL.pathToFileURL(utils.filePathJoin(contentDirPath, documentDirPath, imagePath)).href + const absoluteFilePath = utils.filePathJoin(contentDirPath, documentDirPath, imagePath) const relativeFilePath = utils.relative(utils.filePathJoin(contentDirPath, documentDirPath), absoluteFilePath) - const fileBuffer = yield* $(fs.readFileBuffer(absoluteFilePath)) const { resizedData, height, width, format } = yield* $(processImage(fileBuffer))