Comments (10)
Hey @dtothefp, taking a look now. In the meantime a couple things one thing stands out
does not seem to persist into my Nunjucks template context
Did you know that this is loading those files from the file system and re-merging them for every middleware call?
from templates.
@dtothefp is there something special I need to do to get this to run? I get:
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.2.0
npm ERR! npm v3.8.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node ./index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node ./index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the assemble-view-issue package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs assemble-view-issue
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls assemble-view-issue
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/jonschlinkert/dev/assemble/_debugging/assemble-view-issue/npm-debug.log
from templates.
It looks like the data is on ctx['global-data']
not ctx.globalData
, but you're not camelcasing the file name. Not sure about page-data
yet
from templates.
I was able to run it btw. I'm still looking at the code, but I'm thinking the issue has something to do with your setup in tags/debug.js
.
If you comment out this code then inspect file.data
in a post-render middleware:
app.postRender(/./, (file, next) => {
console.log(file.data);
next();
});
the data is there on file.data
.
from templates.
Hey that's weird that the data is there in postRender
but is not in my template context. Not sure what is going on but this is a significant divergence from when I last updated from 0.17.1
assemble-core@latest
[email protected]
You can see in the above screenshots in iron-node
that in latest
none of the data added in the middleware is present on context.ctx
but in 0.17.1
it is. Therefore, I cannot access that data in my templates so the fact that is there in postRender
doesn't really help me
from templates.
Not sure what is going on but this is a significant divergence
Nunjucks must do something different than other engines we've tested. @doowb and I played around with your code and got everything working just by changing your config, but we also have some ideas for something we can do in templates
to make it more flexible so you don't need to think about it too much.
I'll talk to @doowb, we might be able to do this now
from templates.
@jonschlinkert I just confirmed that the breaking change was introduced into [email protected]
. I'm working on finding the exact commit.
What config change did you make to get it working....was it to the initial nunjucks config?
We have a huge project launching end of this week and would like to upgrade before then otherwise it might be hard and we could end up locked on an old version
from templates.
@jonschlinkert looks like this is the commit that did it. Not sure how it made it's way into [email protected]
unless you did a npm publish
I'm not seeing
from templates.
sorry, I lied it's actually this commit e54e448 which makes way more sense cause it was in the 0.20.0
release
from templates.
Working on something. Give me a few mine. In the meantime, here is a screen I just took using engine-base
instead of nunjucks, just to show that this works usually:
from templates.
Related Issues (20)
- view missing context method HOT 1
- Cannot find module 'async' HOT 3
- TypeError: this.debug.helpers is not a function HOT 10
- new view type: grid
- Removed `view` property from page context HOT 16
- `TypeError: this.run is not a function` HOT 3
- Data from `file.data` not overriding `app.cache.data` HOT 4
- tests
- Layouts not working as expected HOT 10
- preserve whitespace in layouts HOT 1
- async helpers (refactor, externalize, and improve!!!) HOT 1
- request: promise support
- Documentation: What is the difference between templates and template? HOT 5
- refactor view helper
- refactor collection helper
- render helper
- Rendering issue: a param from a previous render call gets injected HOT 8
- Version tag 1.2.9 missing HOT 1
- goals for refactor HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from templates.