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

Layout.prototype.convert does not pass locals #1

Closed
Pimau opened this issue May 31, 2017 · 4 comments
Closed

Layout.prototype.convert does not pass locals #1

Pimau opened this issue May 31, 2017 · 4 comments

Comments

@Pimau
Copy link

Pimau commented May 31, 2017

Shouldn't the line 75 in function Layout.prototype.convert pass the locals? My locals are lost, until I extend ...
return layout.render(child);
... to ...
return layout.render(child,locals);

Or am I on a wrong track?

@burawi
Copy link
Owner

burawi commented May 31, 2017

You're correct!
Can you please provide your code ? so I can find out the problem

@Pimau
Copy link
Author

Pimau commented May 31, 2017

I have something like this …

var mPugLayout = require('pug-layout');
var aMasterPath = mPath.join(runtime.rootPath, "app/views", this.repo.master);
var aMaster = new mPugLayout.Layout(aMasterPath);
var anOutput = aMaster.convert(mPath.join(runtime.rootPath, 'core/ale/base.pug’), {title: “Test”});
theResult.status(200).send(anOutput);

Master is:

doctype html
html
  head
    title= title
  body(ontouchstart="")
    #page-wrapper
      include header.pug
      include content.pug
      include footer.pug
    block controller
      p Controller is missing!

base.pug is:

block content
  p empty
block controller
  p empty

@burawi
Copy link
Owner

burawi commented May 31, 2017

Oh sorry! That was our fault. We fixed it.
update to version 1.2.3 and it will work now!
Thanks for having reported this problem dude

@Pimau Pimau closed this as completed Jun 1, 2017
@Pimau
Copy link
Author

Pimau commented Jun 1, 2017

Thanks for looking into it!

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