mirror of
https://github.com/arikchakma/maily.to.git
synced 2026-04-25 22:25:51 +03:00
[GH-ISSUE #174] Support for conditional and loop templating in render function #60
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/maily.to#60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Ayo-Awe on GitHub (Apr 4, 2025).
Original GitHub issue: https://github.com/arikchakma/maily.to/issues/174
Hey @arikchakma, great work on the library!
I have a quick question.
I noticed that when using the
renderfunction, variables are replaced with placeholders like{{variableName}}, which is really useful for interoperability with external templating engines. However, I noticed that the same doesn’t apply to conditionals and loops.It would be really useful if those could also be replaced with their templating equivalents—such as Handlebars' #if and #each.
For example:
Would love to hear your thoughts!
@arikchakma commented on GitHub (Apr 4, 2025):
Currently, we don't support that because we handle the replacement of the
loopand theconditional. Kinda we are using that as a replacement of a templating engine. But it should be easy to add.@Ayo-Awe commented on GitHub (Apr 4, 2025):
Oh, okay. That makes sense.
Unfortunately, my use case requires exporting the templates for use in a non-Node runtime.
But I'll give it a shot on my end, and let you know how it goes
@arikchakma commented on GitHub (Apr 5, 2025):
Did you find any solutions for this one? It should be simple, imo.
@Ayo-Awe commented on GitHub (Apr 5, 2025):
I still taking a look, but the approach I'm considering is customizing the rendered html of the repeat node.
I wouldn't mind some guidance if you have an idea of a way to go about it