Skip to content

Commit

Permalink
Update unibit.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stackbit-admin authored Oct 21, 2020
1 parent b56faee commit 165c850
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/unibit.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,10 @@ module.exports = class Unibit {
}

getPageByFilePath(context, filePath) {
// remove extension
filePath = path.relative(UNIBIT.pagesDir, filePath);
return _.find(context.site.pages, page => {
const pageUrl = _.get(page, 'relPath');
return filePath === pageUrl;
const pageRelPath = _.get(page, 'relPath');
return filePath === pageRelPath;
});
}

Expand Down

0 comments on commit 165c850

Please sign in to comment.