diff --git a/bridgetown-core/lib/bridgetown-core/generators/prototype_generator.rb b/bridgetown-core/lib/bridgetown-core/generators/prototype_generator.rb index 6275322a9..bed1d2415 100644 --- a/bridgetown-core/lib/bridgetown-core/generators/prototype_generator.rb +++ b/bridgetown-core/lib/bridgetown-core/generators/prototype_generator.rb @@ -79,11 +79,11 @@ def ensure_pagination_enabled # @return [String, nil] def validate_search_term(prototype_page) # @type [String] - search_term = prototype_page.data["prototype"]["term"] - return nil unless search_term.is_a?(String) + search_term = prototype_page.data["prototype"]["term"].to_s + return nil unless search_term.present? if prototype_page.data["prototype"]["collection"] - @configured_collection = prototype_page.data["prototype"]["collection"] + @configured_collection = prototype_page.data["prototype"]["collection"].to_s end unless site.collections[@configured_collection] diff --git a/bridgetown-paginate/lib/bridgetown-paginate/pagination_model.rb b/bridgetown-paginate/lib/bridgetown-paginate/pagination_model.rb index ae0cbd7d0..243f299cd 100644 --- a/bridgetown-paginate/lib/bridgetown-paginate/pagination_model.rb +++ b/bridgetown-paginate/lib/bridgetown-paginate/pagination_model.rb @@ -50,13 +50,18 @@ def run(default_config, templates, site_title) # rubocop:todo Metrics/AbcSize template_config = Bridgetown::Utils.deep_merge_hashes( default_config, template.data["pagination"] || template.data["paginate"] || {} - ) + ).tap do |config| + config["collection"] = config["collection"].to_s if config["collection"].is_a?(Symbol) + config["category"] = config["category"].to_s if config["category"].is_a?(Symbol) + config["tag"] = config["tag"].to_s if config["tag"].is_a?(Symbol) + config["locale"] = config["locale"].to_s if config["locale"].is_a?(Symbol) + end # Is debugging enabled on the page level @debug = template_config["debug"] _debug_print_config_info(template_config, template.path) - next if template_config["enabled"] == false + next unless template_config["enabled"] @logging_lambda.call "found page: " + template.path, "debug" unless @debug