blockpugmixinstemplate-inheritance

in Jade, how I can output the contents of an `extends` block inside of a mixin?


How I can output the contents of an extends block inside of a mixin?

This is a simplified example:

mixins.jade

mixin form()
  form
    block

layout.jade

include mixins.jade

body
  +form
    block content

somepage.jade

extends layout
block content
  input(type=text)

Here I would like to achieve:

<form>
  <input type="text"></input>
</form>

But currently all I get is:

<form></form>

Solution

  • The fact that did not work was identified as a bug after I had created a GitHub issue and submitted a failing spec.

    Per this pull request it's now possible to do what I described in my original question but as stated, this currently only works in the development branch of Jade and will be a part of the next release.