feat: field based media/public folders (#3208)
This commit is contained in:
@ -24,6 +24,7 @@ import {
|
||||
getPreviewStatus,
|
||||
UnpublishedEntryMediaFile,
|
||||
runWithLock,
|
||||
blobToFileObj,
|
||||
} from 'netlify-cms-lib-util';
|
||||
import AuthenticationPage from './AuthenticationPage';
|
||||
import { UsersGetAuthenticatedResponse as GitHubUser } from '@octokit/rest';
|
||||
@ -324,7 +325,7 @@ export default class GitHub implements Implementation {
|
||||
const blob = await getMediaAsBlob(path, null, this.api!.readFile.bind(this.api!));
|
||||
|
||||
const name = basename(path);
|
||||
const fileObj = new File([blob], name);
|
||||
const fileObj = blobToFileObj(name, blob);
|
||||
const url = URL.createObjectURL(fileObj);
|
||||
const id = await getBlobSHA(blob);
|
||||
|
||||
@ -388,7 +389,7 @@ export default class GitHub implements Implementation {
|
||||
|
||||
return getMediaAsBlob(file.path, file.id, readFile).then(blob => {
|
||||
const name = basename(file.path);
|
||||
const fileObj = new File([blob], name);
|
||||
const fileObj = blobToFileObj(name, blob);
|
||||
return {
|
||||
id: file.id,
|
||||
displayURL: URL.createObjectURL(fileObj),
|
||||
|
Reference in New Issue
Block a user