Open mkantor opened 4 years ago
I'm betting the easiest approach here will be to enhance get
to make it able to do a superset of what partials can do.
Last time I checked the handlebars-rust library didn't provide an easy to way to extend built in functionality like >
. Even if I could do that it'd make templates less portable.
Steps to enhance the get
helper so its behavior is a superset of what partials can do:
@partial-block
for the included file if it's a template
Currently the
get
helper and handlebars partial syntax ({{> blah}}
) serve similar purposes (including content from other files), but they don't fully overlap:get
helper can also embed content from executables or static files, but partials can't.get
can't.get
is passed a route, but partial syntax uses filesystem paths ({{get "/foo/bar"}}
vs{{> foo/bar.html.hbs}}
).get
.This is confusing and annoying. It would be great to eliminate these tradeoffs so that you don't need to think about when to use each one, either by combining them or making one a superset of the other.