Middleman build error

I’m running in circles trying to figure out where I went wrong. I’m moving layouts, stylesheets and the like from source/* to source/assets/*.

I’ve made the changes in config.rb

config[:layouts_dir]  =    'assets/layouts'
config[:partials_dir] =    'assets/layouts/partials'
config[:css_dir]      =    'assets/stylesheets'

When I’m running middleman in development mode middleman everything works fine. However, once I build, middleman build errors crop up. For some reason middleman is trying to build the contents of assets/layouts I get the following:

Tried to render a layout (calls yield) at /src/project12/source/assets/resources/layouts/layout.erb like it was a template. Non-default layouts need to be in source/assets/layouts

Everything builds as expected, the layouts in ‘assets/layouts’ are used to build the site.

  1. I don’t know if this is legal to have partials in subdirectory of layouts directory.
  2. I don’t know if this makes any difference, but why use config[:layouts_dir]='assets/layouts' instead of set : layouts_dir, 'assets/layouts'?

Well this works

config[:partials_dir] =    'layouts/partials'
config[:layouts_dir]  =    'layouts'

as does (I was thinking it was an ordering thing for awhile)

config[:layouts_dir]  =    'layouts'
config[:partials_dir] =    'layouts/partials'

So I would think the other would also work…

As to you I use config[:layouts_dir] opposed to set : layouts_dir, 'assets/layouts' well I honestly have no good reason other than the Middeleman Configuration Guide states:

You can also use a somewhat newer syntax:

config[:js_dir] = 'js'

Personally I prefer the set: syntax but… I’ve figured the mention was for guidance towards recommended practices that should pay off long term. Anyway, both give the exact same build failure, build it trying to turn my layouts into actual *.html pages (just the layouts, and not the partials).

UPDATE:
I have a little more time to play around the site. I found that fails:

config[:layouts_dir]  =    'assets/layouts'
config[:partials_dir] =    'assets/layouts/partials'

yet the following works

config[:layouts_dir]  =    'assets/_layouts'
config[:partials_dir] =    'assets/_layouts/_partials'

I must prefix the the directory , in the file system on config with _.

Have you tried to just put partials in a separate subdir, not inside layouts dir?

I have tried that, same problem. Since, Middleman v4 isn’t going to support the partial_dir I switched to referencing partial but it site path.

As long as my layout is any directory that isn’t /layout or starts with _ Middleman attempts to turn the *.erb into a page.

I’m throwing my hands up and moving on for now. I have a feeling what every the issue must be something on my end.