jekyll-paginate-v2
jekyll-paginate-v2 copied to clipboard
"undefined method 'strip' " error when a list is empty
When trying to migrate my website from jekyll-paginate to jekyll-paginate-v2, I ran into this error:
jekyll-paginate-v2/autopages/utils.rb:61:in `block (2 levels) in ap_index_posts_by': undefined method `strip' for nil (NoMethodError)
I discovered that the issue was I had a page with this config at the top:
categories:
-
Because the category entry was empty, Jekyll read it as nil. AutoPages then tried to read this nil value as if it was a string. This should be fixable by adding this line to utils.rb:61:
next if key.nil?