Tag attributes look similar to html, however their values are just regular JavaScript.
a(href='google.com') Google
a(class='button', href='google.com') Google
<a href="google.com">Google</a><a href="google.com" class="button">Google</a>
All the normal JavaScript expressions work fine too:
- var authenticated = true
body(class=authenticated ? 'authed' : 'anon')
<body class="authed"></body>
If you have many attributes, you can also spread them across many lines:
input(
type='checkbox'
name='agreement'
checked
)
<input type="checkbox" name="agreement" checked="checked"/>