Map layout.erb from an internal directory

I apologize if this has been covered, I looked and either couldn’t find it or didn’t know how to ask.

I would like to setup a protected directory called internal-docs which is where my employees can access current company documents, but I cannot seem to figure out how to have the default layout.erb file and associated dependencies create the system-wide view for the files in this directory. Is this possible?

Thank you for your help.

Oh, and I absolutely love Middleman…its becoming my go-to since I found it.

Thanks again,
Chuck

Are you asking how to display a list of files that are contained in a directory? If so, this will help:

Todd

Thanks for responding…great tip, but not what I was looking for - maybe this is why no one else responded :smile:

Let me try and explain differently. In the root ( /source ) directory where index.html.erb is located, all files share the /layouts/layout.erb file for the basic structure of the site. Any other html.erb page I place in the source directory will also be subject to the layout.erb file. But, if I create another directory inside the source directory and create an html.erb file in there i.e /source/about/index.html.erb - it does not get treatment from the layout.erb file because it is outside the asset pipeline or path. My question is whether there is a configuration setting to add directories? Does this make better sense?

Thank you for taking the time to respond.

Chuck

Your layouts directory should be a child of your source directory. As long as that’s the case, you should be able to make whatever subdirectories of /source you want, populate them with .html.erb pages, and the layout.erb file will apply to all of them by default.

You can also configure specific layouts to apply to specific directories, using wildcards. For example:

# Override the default layout with a different one for pages in the `/about/*` directory.
page "/about/*", :layout => "layout-about"

If those things aren’t working, then I suspect there’s some other issue that’s preventing it from functioning properly.

I don’t know what I did, but that works…must have forgotten the .erb the first time…

Thanks Bryan.