Nested layout for blog articles not being applied

Per the docs on setting up a nested layout for blog articles, I’ve implemented the following setup. However, it’s still just using the main layout.erb layout. It’s like the page "blog/*", :layout => :article_layout setting isn’t taking. Thanks in advance!

##config.rb

activate :blog do |blog|
  blog.permalink = "blog/{year}/{month}/{day}/{title}.html"
end

page "blog/*", :layout => :article_layout

layout.erb

<div id="content">
  <%= yield %>
</div>

##article_layout.erb

<% wrap_layout :layout do %>
  <div id="article-wrapper">
    <%= yield %>
  </div>
<% end %>

But this is what I’m getting:

expected output

<div id="content">
  <div id="article-wrapper"></div>
</div>

actual output

<div id="content">
</div>

Have you tried configuring the layout in the blog config instead?

For example:

activate :blog do |blog|
  blog.permalink = "blog/{year}/{month}/{day}/{title}.html"
  blog.layout = "article_layout"
end

That worked perfectly. I don’t know why I hadn’t considered that. I guess because I was trying to follow the suggestion in the docs. :smile:

Thanks so much!