eta icon indicating copy to clipboard operation
eta copied to clipboard

Configuration Option "views": support multiple directories with fallbacks

Open recrof opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

I have multiple directories that contain templates with same file name:

templates/more-specific-dir/header.eta
templates/more-specific-dir/footer.eta
templates/header.eta
templates/footer.eta
templates/body.eta

I would like to be able to use template from templates/more-specific-dir/ if it exists, but fallback to templates/ if eta can't find it in first directory(like body.eta).

Describe the solution you'd like

Configuration option views could support array as value. example: ['templates/primary-directory', 'templates/first-fallback', 'templates/second-fallback', ...]

Describe alternatives you've considered

ejs supports multiple directories for views, however I like Eta better.

recrof avatar May 31 '24 18:05 recrof

It seems a cool feature

multivoltage avatar Jun 05 '24 17:06 multivoltage

This is actually an intentional design decision, I think having automatic fallbacks is too "magical" and can cause confusion. Thanks for the feedback though!

bgub avatar Sep 13 '25 19:09 bgub