Skip to content

Commit

Permalink
fix: use '/' for root path
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah committed May 13, 2020
1 parent 7f42777 commit 47fed70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/netlify-cms-core/src/__tests__/backend.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ describe('Backend', () => {
partial: false,
raw: '---\ntitle: "Hello World"\n---\n',
data: { title: 'Hello World' },
meta: { path: '' },
meta: { path: '/' },
label: null,
isModification: true,
mediaFiles: [{ id: '1', draft: true }],
Expand Down
2 changes: 1 addition & 1 deletion packages/netlify-cms-core/src/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const prepareMetaPath = (path: string, collection: Collection) => {
return path;
}
const dir = dirname(path);
return dir.substr(collection.get('folder')!.length + 1);
return dir.substr(collection.get('folder')!.length + 1) || '/';
};

export class Backend {
Expand Down

0 comments on commit 47fed70

Please sign in to comment.