Last Updated: February 25, 2016
·
2.764K
· joshwlewis

Directory Indexes with middleman-blog

Middleman is a static site generator built in Ruby, you can check it out here.

I was having trouble with it's blogging section middleman-blog last night where directory indexes worked for content, but not for blog posts and categories.

For example, middleman build was giving me this tree:

/index.html
/articles/index.html
/about/index.html
/articles/blog_post
/articles/tags/ruby

You see the regular content was generating indexes, but the last few were actually being saved without extensions. I thought this was a bug, but it's just a configuration error. Turns out that I had done this in config.rb:

activate :directory_indexes
activate :blog do
   ...
end

Well, that's backwards. You have to do it like this:

activate :blog do
   ...
end
activate :directory_indexes

Hope that saves someone else some time

1 Response
Add your response

Thank you!

over 1 year ago ·