yosssi / ace

HTML template engine for Go
MIT License
835 stars 89 forks source link

Optional attributes? #67

Closed yacoob closed 5 years ago

yacoob commented 8 years ago

Context: I'm trying to use ACE within Hugo. Is there a way to an attribute optional? I want to have a div that has an attribute only if a template variable is set. In other words: Right now if I say:

div data-foo={{ .foo }}

I'll get

<div data-foo="">

What do I need to say to get

<div>

if .foo is not set?