I am trying to use a mixin in the middle of a line of jade like this...
p some paragraph text !{ 'this'+'works' } but !{ +myMixin() } breaks it!
But it doesn't work. I can't figure out how to reference a mixin in the middle of a line of jade. Is it possible?
You need special way to use jade mixins inline:
p.
Hello I'm using #[+jadeMixin(param)] inline.
It's not possible to put a mixin in a sentence like that. What you can do is include blocks inside the mixin and use pikes | for plain text.
mixin myMixin()
strong
block
p This is a sentence
+myMixin()
| with bold text
| and this is the rest of it
Which will render:
<p>This is a sentence <strong>with bold text</strong> and this is the rest of it</p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With