samskivert / jmustache

A Java implementation of the Mustache templating language.
Other
834 stars 128 forks source link

Question on partials #86

Closed wing328 closed 7 years ago

wing328 commented 7 years ago

I've a question about accessing partial mustache templates via relative path.

Here is an example provided in the doc:

{{> box}}

Ref: https://mustache.github.io/mustache.5.html

If I need to access the partial in the parent folder, can I do {{> ../box}} or {{> ..\box}} or the partials must be in the same folder?

If relative path is supported, would that work across different environments (e.g. Windows. Linux, Mac, etc)?

Thanks.

samskivert commented 7 years ago

You handle finding and loading the partial via the in TemplateLoader class you pass to the compiler. So you decide how all that works. If you want .. to work, make it work. If you want things to work across platform use java.io.File or java.nio.files.Path. You have total control.