neuland / pug4j

a pug implementation written in Java (formerly known as jade)
MIT License
61 stars 12 forks source link

Mixins - Default Argument's Values - is it working? #14

Closed godzzo closed 11 months ago

godzzo commented 2 years ago

I tried to use mixins default argument values, as the PugJS Documentation suggests, but not working with JEXL.

Should it be working, is it an implemented feature of Pug4J? Or is it an ExpressionEngine dependent feature?

There is an Issue: Default values for arguments in mixins #743, where a comment say it is Runtime dependent.

Pug - mixins - default-arguments-values

//- Declaration
mixin article(title='Default Title')
  .article
    .article-wrapper
      h1= title

//- Use
+article()

+article('Hello world')
chbloemer commented 1 year ago

I implemented default variables on mixin arguments in version 2.1.0. Please try it out.