I would like to move source/index.html.erb
into a directory to sit nicely alongside the partials I'm using in index.html.erb
.
Is there an existing way to move the source/index.html.erb
into a directory?
Something like
# config.rb
root_to 'root#index'
So that I can do
source/
root/
|- _hero_box.html.erb
|- index.html.erb
You have two options here. Neither involve moving index.html.erb
out of the root of your source directory.
The first one is to provide the path to the partial in your source. It would look like:
<%= partial 'root/hero_box' %>
The alternative is to configure middleman to look for your partials in a specific directory:
# config.rb
set :partials_dir, 'root'
You would not need to prefix the partial with the path in this case.