Blog nested layout does not render on individual article

Hello. I’m making a website that includes a blog at /blog, but when I try to view an individual article, the blog_layout does not render. It does render successfully on the blog’s index.html.erb. I’ve spent all day on it trying different things and I’m getting nowhere. Would really appreciate some help / fresh eyes. Ideas?

My config.rb:

activate :blog do |blog|
  blog.name = "blog"
  blog.permalink = "blog/{year}/{month}/{title}"
  blog.sources = "blog/{year}-{month}-{day}-{title}.html"
  blog.layout = "blog_layout"
  blog.summary_separator = /(READMORE)/
  blog.tag_template = "tag.html"
  blog.calendar_template = "calendar.html"
end

with_layout :blog_layout do
  page "/blog/*"
end

My layouts/blog_layout.erb:

<% wrap_layout :layout do %>
  <article>
    <div id="main" role="main">
      <%= yield %>
    </div>
    <aside>
      <h2>Recent Articles</h2>
        <ol>
          <% blog.articles[0...10].each do |article| %>
            <li><%= link_to article.title, article %> <span><%= article.date.strftime('%b %e') %></span></li>
          <% end %>
        </ol>
     </aside>
  </article>
<% end %>

Try

with_layout :blog_layout do
  page "/blog/"
end

without the *.

Thanks, but no luck. “blog/”, “/blog”, and “blog/*” didn’t work either.

Oh, it looks like I had to end the article filename with .html.erb instead of .html for the layout to be brought in. But then because I have my posts in a blog/ directory in source/, it wouldn’t create a relative path to the assets (looks for blog/name/css/bootstrap.css instead of css/bootsrap), so I had to make sure to go back and make my link hrefs go to /css/bootstrap.css instead of css/bootstrap.css. So its all working now, thanks, hope this helps someone else :slight_smile: