middleman / middleman-blog

Blog Engine Extension for Middleman
https://middlemanapp.com
MIT License
326 stars 179 forks source link

Activating multiple blogs prevents non-blog pages from working. #249

Closed twss closed 7 years ago

twss commented 9 years ago

Created a new blog project using middleman init test --template=blog, removed the default activate :blog from config.rb and added:

activate :blog do |blog|
  blog.name = "cats"
  blog.prefix = "cats"
end

activate :blog do |blog|
  blog.name = "dogs"
  blog.prefix = "dogs"
end

Created a file test.html.erb, containing only:

<h1><%= "Test" %></h1>

When navigating to http://127.0.0.1:4567/test/, I receive the following

 RuntimeError at /test.html

You must either specify the blog name in calling this method or in your page frontmatter (using the 'blog' blog_name)

Ruby    /Users/.../gems/middleman-blog-3.5.3/lib/middleman-blog/helpers.rb: in blog_controller, line 36
Web     GET 127.0.0.1/test.html

Clearly, we don't want non-blog content in a blog.

tdreyno commented 9 years ago

Is something in your layout expecting blog data?

twss commented 9 years ago

Doh! Yes, that. Exactly that!

I'd forgotten to remove the blog-related stuff from the template.

Cheers. Fresh eyes always help. :+1:

BTW are you aware that the multiblog tests are not being run by the default test suite currently, and when included they all fail?

As the @three_one tests are only run for Middleman 3.1.x. Shouldn't this be 3.1.x and up.

twss commented 9 years ago

Something else may be amiss in the test suite.

iwarner commented 7 years ago

Hiya the whole testing needs looking at as Travis is failing in many areas at the moment. Can you open a new issue regarding the testing please.