diff --git a/lib/jekyll-feed/generator.rb b/lib/jekyll-feed/generator.rb index 8f1f571a..76ef0618 100644 --- a/lib/jekyll-feed/generator.rb +++ b/lib/jekyll-feed/generator.rb @@ -69,16 +69,7 @@ def collections @collections = normalize_posts_meta(@collections) @collections.each_value do |meta| - meta_categories = meta["categories"] - for_collection = case meta_categories - when Array - meta_categories - when true - @site.categories.keys - else - [] - end - meta["categories"] = for_collection.to_set + normalize_categories(meta) end @collections @@ -151,6 +142,19 @@ def normalize_posts_meta(hash) hash end + def normalize_categories(meta) + meta_categories = meta["categories"] + for_collection = case meta_categories + when Array + meta_categories + when true + @site.categories.keys + else + [] + end + meta["categories"] = for_collection.to_set + end + def disabled_in_development? config && config["disable_in_development"] && Jekyll.env == "development" end