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 %>