Get blog name in layout file for all articles

Dear folks!

On a complex site with multiple blogs we need to add a blog name class to all articles.

<%= blog_controller('blog1').config[:name] %>

unfortunately results in this error message:

undefined method `config' for #<Middleman::BlogExtension:0x007fc9d8353af0>

The names of the blog are defined this way:

activate :blog do |blog|
  blog.name = "blog1"
  …
end

activate :blog do |blog|
  blog.name = "blog2"
  …
end

Help is really appreciated Thank you very much!

Gosh! As easily as this:

    - if current_resource.is_a? Middleman::Blog::BlogArticle
      = blog_controller.name

And here is the working example—in case somebody can re-use it:

- if current_resource.is_a? Middleman::Blog::BlogArticle
  - blogname = blog_controller.name
  - current_page.add_metadata( {'body_class' => blogname} )

body class="#{page_classes} #{current_page.metadata['body_class']}"