Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic if/else logic in template placeholders #23

Closed
dafky2000 opened this issue Oct 16, 2017 · 3 comments
Closed

Add basic if/else logic in template placeholders #23

dafky2000 opened this issue Oct 16, 2017 · 3 comments

Comments

@dafky2000
Copy link
Owner

Right now we simply search for {{data.varname}} and replace with defined. Would be nice to have something like {{data.varname:replace with this text if varname is defined}}.

Than we could do something like:

{{data.link1:<a href="staticlink.html">Test link</a>}}

Kind of useless right now but is required for some advanced functionality defined in #22

@dafky2000
Copy link
Owner Author

Instead of use the colon : as the separation, it is safe to assume that the first space separates the content from the condition.

{{data.key text to use if data.key is defined and non-empty}}

@dafky2000 dafky2000 added this to the v0.1.0 milestone Oct 19, 2017
dafky2000 added a commit that referenced this issue Dec 9, 2017
@dafky2000
Copy link
Owner Author

Since we are going to try to support Mustache syntax than the above should be valid as well as:

{{#data.key}}
   Some data if data.key has a value
{{/data.key}}

This will likely be under some option where we can define the opening and closing "braces" to include the data variable name.

@dafky2000
Copy link
Owner Author

Closed via #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant