How to get "blog.tags" from config.rb?

All I want to do is generate feeds for each category, but the “old” way of doing it via

ready do
   blog.artices...
end

Gives an error saying blog is undefined. The documentation has about 50% of a workaround creating a custom collection, but all I want is the built-in blog.tags that’s populated after configuration. Is this really the new way to do this?

Looking at middleman-blog’s source code, you can apparently do this in config.rb:

ready do
  _, blog = extensions[:blog].first
  blog.data.tags.each_pair do |tag, articles|
    # do whatever
  end
end

Note that extensions[:blog] gives you a hash of all the blog instances. If there are more than one, then you need to find the right instance.

Hope this helps.