Skip to content

Commit

Permalink
Fix rubocop errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jez committed Dec 31, 2022
1 parent 388b509 commit be7477f
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions lib/jekyll-feed/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit be7477f

Please sign in to comment.