Inclusion of mixins in a workaround

As mentioned in the github # 70 release , including mixins, is not supported.

Are there any good solutions or alternative solutions?

+5
source share
1 answer

the implementation of Pajade include does not support mixins, but "extends" does, although you need to use a "block". So what could you do if you just need to import a single file:

extends mixins.jade
block layout
  +link("example", "http://example.com/")

mixins.jade:

mixin link(text, url)
  a(href=url)= text

block layout

(Answering my own question, because I was looking for everything to figure it out myself, and thought it might be useful to others)

+3
source

All Articles