Is it possible to use Snap/Heist in such a way that not every template has an auto-generated route? For example, suppose I have a template called "outline" with an <apply-content/>
tag, and a template called "index" which calls <apply template="outline">
. I want the "index" template to be visible under the route "/", and the "outline" template to not have a route. I've tried the following:
Calling
heistInit
and putting bothindex.tpl
andoutline.tpl
in thetemplates
directory. This automatically creates a route for "outline".Putting
outline.tpl
in a separate directory and callingaddTemplatesAt
. This also automatically creates a route foroutline
.Calling
heistInit'
instead ofheistInit
, with an empty Config, as follows:h <- nestSnaplet "" heist $ heistInit' "templates (Heist.emptyHeistConfig { Heist.Internal.Types._hcNamespace = "" })
Doing the last way means I have to add the routes by hand, which is ok. But even though I could serve the templates using render
or heistServeSingle
, the templates could not see each other when using <apply>
.
I know this feels like only a "minor" issue, I could just let the helper-templates be visible, but to me that feels sloppy. I was curious to see if http://snapframework.com did something to get around this, but it appears they left their helper templates visible, for example: http://snapframework.com/nav