How to import mixins using `pajade` efficiently?

Turning to https://github.com/SyrusAkbary/pyjade/issues/27 , it seems that jinja2 does not allow importing mixins from external files.

However, I have helper.jade that has a lot of mixins in it. If I need to use many different mixins from one file, does this mean that I have to do it like this:

- from 'helper.jade' import mixin_a, mixin_b, mixin_c, mixin_d...

mixin mixin_a(var1, var2, var3)
  div blah blah blah

which import statement is pretty inefficient.

Is there a better way to do this. For example, does it look like the following syntax?

- import 'helper.jade' as h

mixin h.mixin_a(var1, var2, var3)
  div blah blah blah
+5
source share
1 answer

, , pyjade, :

0

All Articles