jekyll-paginate-v2 icon indicating copy to clipboard operation
jekyll-paginate-v2 copied to clipboard

"undefined method 'strip' " error when a list is empty

Open michaeldickens opened this issue 11 months ago • 0 comments

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?

michaeldickens avatar Mar 14 '24 02:03 michaeldickens