5

As mentioned in the github issue #70 including mixins aren't supported.

Are there any good workarounds or alternative solutions?

Albin
  • 2,410
  • 2
  • 29
  • 27

1 Answers1

3

Pyjade's implementation of include doesn't support mixins, but "extends" does, although you have to use a "block". So what you could do if you just need to import one 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 searched hard before figuring this out myself and thought it could be helpful to others)

Albin
  • 2,410
  • 2
  • 29
  • 27
  • Does it work with multiple extensions? E.g., mixins.jade -> base.jade -> my_template.jade. – knite Dec 04 '14 at 11:18
  • Yes. That's how I have things set up now. You have to use another block of course. If anyone knows a better way please let me know. – Albin Dec 04 '14 at 16:01