Failing to create atom feeds for all tags

I’d like to create atom feeds for all tags, instead of just one for all articles. Now, there’s a common solution for this, as mentioned in this thread: Middleman Blog: RSS Feeds Per-Tag

I can find this code (and a similar other example) a few times in the web, so this seems to work for people. However, when I add this to my config.rb and try to build the site, I get a NameError:

/home/red_trela/.gem/ruby/gems/middleman-blog-4.0.0/lib/middleman-blog/blog_data.rb:170: warning: duplicated key at line 170 ignored: :lang
== Blog Sources: {year}-{month}-{day}-{title}.html (:prefix + :sources)
/home/red_trela/git/mathys.io/blog/config.rb:89:in `block in evaluate_configuration!': undefined local variable or method `blog' for #<Middleman::ConfigContext:0x0055b1ab76c700> (NameError)
        from /home/red_trela/.gem/ruby/gems/middleman-core-4.0.0/lib/middleman-core/callback_manager.rb:51:in `instance_exec'
        from /home/red_trela/.gem/ruby/gems/middleman-core-4.0.0/lib/middleman-core/callback_manager.rb:51:in `block in execute'
        from /home/red_trela/.gem/ruby/gems/hamster-2.0.0/lib/hamster/vector.rb:1316:in `each'
        from /home/red_trela/.gem/ruby/gems/hamster-2.0.0/lib/hamster/vector.rb:1316:in `traverse_depth_first'
        from /home/red_trela/.gem/ruby/gems/hamster-2.0.0/lib/hamster/vector.rb:431:in `each'
        from /home/red_trela/.gem/ruby/gems/middleman-core-4.0.0/lib/middleman-core/callback_manager.rb:51:in `execute'
        from /home/red_trela/.gem/ruby/gems/middleman-core-4.0.0/lib/middleman-core/callback_manager.rb:28:in `block in install_methods!'
        from /home/red_trela/.gem/ruby/gems/middleman-core-4.0.0/lib/middleman-core/callback_manager.rb:52:in `instance_exec'
        from /home/red_trela/.gem/ruby/gems/middleman-core-4.0.0/lib/middleman-core/callback_manager.rb:52:in `block in execute'
        from /home/red_trela/.gem/ruby/gems/hamster-2.0.0/lib/hamster/vector.rb:1316:in `each'
        from /home/red_trela/.gem/ruby/gems/hamster-2.0.0/lib/hamster/vector.rb:1316:in `traverse_depth_first'
        from /home/red_trela/.gem/ruby/gems/hamster-2.0.0/lib/hamster/vector.rb:431:in `each'
        from /home/red_trela/.gem/ruby/gems/middleman-core-4.0.0/lib/middleman-core/callback_manager.rb:52:in `execute'
        from /home/red_trela/.gem/ruby/gems/middleman-core-4.0.0/lib/middleman-core/callback_manager.rb:28:in `block in install_methods!'
        from /home/red_trela/.gem/ruby/gems/middleman-core-4.0.0/lib/middleman-core/application.rb:292:in `start_lifecycle'
        from /home/red_trela/.gem/ruby/gems/middleman-core-4.0.0/lib/middleman-core/application.rb:265:in `initialize'
        from /home/red_trela/.gem/ruby/gems/middleman-cli-4.0.0/lib/middleman-cli/build.rb:51:in `new'
        from /home/red_trela/.gem/ruby/gems/middleman-cli-4.0.0/lib/middleman-cli/build.rb:51:in `build'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor/invocation.rb:115:in `invoke'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor.rb:40:in `block in register'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /home/red_trela/.gem/ruby/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /home/red_trela/.gem/ruby/gems/middleman-cli-4.0.0/bin/middleman:23:in `<top (required)>'
        from /home/red_trela/bin/middleman:23:in `load'
        from /home/red_trela/bin/middleman:23:in `<main>'

Any idea what I could be do wrong? I put it right after my activate :blog do |blog| block. Wondering whether the 4 release makes any changes to this code necessary.