Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,15 @@ class SourcebitDataClient {
return fse.readJson(DEFAULT_FILE_CACHE_PATH);
}

async getStaticPages() {
const data = await this.getData();
let paths = _.map(data.pages, (page) => page);
return paths;
}
Comment on lines +381 to +385
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JugglerX isn't the path variable should be pages?
And also, why not:

    async getStaticPages() {
      const data = await this.getData();
      return data.pages;
  }

And if are already there, do we really need this low resolution helper methods?
Wouldn't calling sourcebitDataClient.getData().pages be enough?


async getStaticPaths() {
const data = await this.getData();
let paths = _.map(data.pages, (page) => page.path);
if (process.env.NODE_ENV === 'development') {
paths = paths.concat(_.map(paths, (pagePath) => pagePath + (pagePath !== '/' ? '/' : '')));
}
Comment on lines -384 to -386
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return paths;
}

Expand Down
Loading