You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my opinion, an ability to make templates a slightly dynamic will help visualize possible changes in templates based on template variables. I'm thinking about something similar to Selmers' {{ if some-var = "value" }}...{{ endif }}. I don't propose any other tags but if probably would be helpful.
An example for the case when conditions could be useful. Let's suppose we have basic deps.edn file template and we want to add to it different features that have its own dependencies. So for instance, we would like to give our users optional ability to add database config to project created from a template. Now basic deps.edn could look like this:
First of all, thank you for the fast and detailed reply!
to, say, a temporary folder, using Selmer to perform transformations
Yes, I get it, and I do it almost like this. And it's totally ok as a solution, but the same time it feels a little bit inconvenient comparing with built-in abilities 🤔.
Some helper functions might make this easier, perhaps
an example template repo on GH showing how this can be done
Yes, it would be great to have some helpers and, probably, guides. Thanks!
In my opinion, an ability to make templates a slightly dynamic will help visualize possible changes in templates based on template variables. I'm thinking about something similar to Selmers'
{{ if some-var = "value" }}...{{ endif }}
. I don't propose any other tags butif
probably would be helpful.An example for the case when conditions could be useful. Let's suppose we have basic deps.edn file template and we want to add to it different features that have its own dependencies. So for instance, we would like to give our users optional ability to add database config to project created from a template. Now basic deps.edn could look like this:
And then, if we pass arg, for example,
:db true
to generating command, we add deps internally and get result:But if we had had built-in
if
condition in template, we could have written the same template a slightly more explicit:The text was updated successfully, but these errors were encountered: