Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

include with yield does not yield in the right place #770

Closed
samf opened this Issue · 4 comments

2 participants

@samf

I am having trouble with include, where the included file has a yield statement in it.

This is with version 0.27.2.

What I want is to have static files layout.jade and index.jade, where index.jade includes layout.jade. Here is a proposed layout:

!!!
head
  title The Title
body
  #content
    yield
  #footer
    p foot

And the index:

include layout
  p this is the content

But here is the result:

<!DOCTYPE html>
<head>
  <title>The Title</title>
</head>
<body>
  <div id="content"></div>
  <div id="footer">
    <p>foot
      <p>this is the content</p>
    </p>
  </div>
</body>

Jade is embedding "this is the content" as though there were no yield statement in the layout. It should be in the div with the id of "content".

Am I doing something wrong, or is this an issue?

Thanks!

@tj
Owner
tj commented

you're wanting extend, include just literally includes things, extend wraps itself with the file you specify, useful for layouts

@tj tj closed this
@tj
Owner
tj commented

actually your example should work, but still I'd check out extend

@tj tj reopened this
@samf
@tj tj closed this issue from a commit
@tj tj fix include yields. Closes #770 454975f
@tj tj closed this in 454975f
@tj
Owner
tj commented

fixed in 0.27.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.