mbanting / metalsmith-prismic

A Metalsmith.io plugin to pull in content from Prismic.io
MIT License
48 stars 19 forks source link

Get complete data from prismic pagination #20

Closed nblumoe closed 9 years ago

nblumoe commented 9 years ago

With these changes, metalsmith-prismic pulls data from all pages when a resource is paginated.

fixes #19

nblumoe commented 9 years ago

Tests seem to fail because test data because the API isn't mocked and the response changed. However, this fix also has one issue: If someone using the lib relies on pageSize limiting the number of retrieved documents, this breaks now. Will send an updated PR when tests were adjusted and a flag parameter introduced to pull all pages (defaulting to the previous behaviour).

nblumoe commented 9 years ago

@mbanting thoughts?

mbanting commented 9 years ago

This is great @nblumoe, thanks for doing this.

nblumoe commented 9 years ago

Thank YOU for building the plugin!

One note: I would say it would be the better default, to always pull all pages. However, I did not want to implement a breaking change and this would change the behavior when people update the plugin. You might want to consider adding a deprecation warning and then in a later release change to an allPages: true default.