Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
samf opened this issue Sep 17, 2012 · 4 comments
Closed

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

samf opened this issue Sep 17, 2012 · 4 comments

Comments

@samf
Copy link

samf commented Sep 17, 2012

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
Copy link
Contributor

tj commented Sep 18, 2012

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

@tj tj closed this as completed Sep 18, 2012
@tj
Copy link
Contributor

tj commented Sep 18, 2012

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

@tj tj reopened this Sep 18, 2012
@samf
Copy link
Author

samf commented Sep 18, 2012

Weird. Version 0.27.2?

I'll take your advice on "extends", though -- looks more like what I want.

Let me know if you want me to send you any debug info about my environment,
where this is failing.

Thanks!

  • Sam

On Tue, Sep 18, 2012 at 3:26 PM, TJ Holowaychuk notifications@github.comwrote:

<title></title>

Page

some content

and some more


Reply to this email directly or view it on GitHubhttps://github.com//issues/770#issuecomment-8671243.

@tj tj closed this as completed in 454975f Sep 18, 2012
@tj
Copy link
Contributor

tj commented Sep 18, 2012

fixed in 0.27.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants