File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
packages/@contentlayer/source-files/src/fetchData/mapping Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { fs, unknownToRelativePosixFilePath } from '@contentlayer2/utils'
44import { identity , OT , pipe , T } from '@contentlayer2/utils/effect'
55import type * as ImageScript from 'imagescript'
66import type sharp from 'sharp'
7+ import * as URL from 'url'
78
89import { FetchDataError } from '../../errors/index.js'
910import type { HasDocumentContext } from '../DocumentContext.js'
@@ -56,7 +57,7 @@ const getImageFieldData = ({
5657 const documentDirPath = utils . dirname ( documentFilePath )
5758
5859 const filePath = utils . filePathJoin ( documentDirPath , imagePath )
59- const absoluteFilePath = utils . filePathJoin ( contentDirPath , documentDirPath , imagePath )
60+ const absoluteFilePath = URL . pathToFileURL ( utils . filePathJoin ( contentDirPath , documentDirPath , imagePath ) ) . href
6061 const relativeFilePath = utils . relative ( utils . filePathJoin ( contentDirPath , documentDirPath ) , absoluteFilePath )
6162
6263 const fileBuffer = yield * $ ( fs . readFileBuffer ( absoluteFilePath ) )
You can’t perform that action at this time.
0 commit comments