Merge pull request #617 from netlify/fix-trailing-slash

Fix collections breaking if folder has trailing slash.
This commit is contained in:
Caleb 2017-09-18 14:37:16 -06:00 committed by GitHub
commit 62d88b9e6f

View File

@ -42,7 +42,7 @@ const selectors = {
return collection.get('fields');
},
entryPath(collection, slug) {
return `${ collection.get('folder') }/${ slug }.${ this.entryExtension(collection) }`;
return `${ collection.get('folder').replace(/\/$/, '') }/${ slug }.${ this.entryExtension(collection) }`;
},
entrySlug(collection, path) {
return path.split('/').pop().replace(/\.[^\.]+$/, '');