diff --git a/bridgetown-prismic.gemspec b/bridgetown-prismic.gemspec index 03603b6..5801906 100644 --- a/bridgetown-prismic.gemspec +++ b/bridgetown-prismic.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.add_dependency "bridgetown", ">= 1.2.0", "< 2.0" spec.add_dependency "prismic.io", ">= 1.8" - spec.add_dependency "async", ">= 2.0" + spec.add_dependency "async", ">= 1.30", "< 2.0" spec.add_development_dependency "bundler" spec.add_development_dependency "rake", ">= 13.0" diff --git a/lib/bridgetown-prismic.rb b/lib/bridgetown-prismic.rb index ede23a8..d9262c6 100644 --- a/lib/bridgetown-prismic.rb +++ b/lib/bridgetown-prismic.rb @@ -33,7 +33,7 @@ def self.prismic_data(origin, doc = nil) # rubocop:todo Metrics/AbcSize, Metrics site = Bridgetown::Current.site @prismic_data = Bridgetown::Utils::PrismicData.new(scope: self) - unless doc + unless doc && doc.instance_of?(Prismic::Document) prismic_id = origin.id.split("/").last # NOTE: if site.config.prismic_preview_token isn't set, it will default to # master (published) ref diff --git a/lib/bridgetown-prismic/api.rb b/lib/bridgetown-prismic/api.rb index 8654ed1..092c4ea 100644 --- a/lib/bridgetown-prismic/api.rb +++ b/lib/bridgetown-prismic/api.rb @@ -35,6 +35,8 @@ def query_prismic(custom_type, options = {}) page = 1 finalpage = false options["pageSize"] ||= 100 # pull in as much data as possible for a single request + query_options = Bridgetown::Current.site.config.prismic_query_options + options.merge!(query_options) if query_options until finalpage options["page"] = page