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

data variable reference bug #44

Closed
icai opened this issue Oct 12, 2017 · 2 comments
Closed

data variable reference bug #44

icai opened this issue Oct 12, 2017 · 2 comments

Comments

@icai
Copy link
Contributor

icai commented Oct 12, 2017

https://github.com/zimmen/gulp-twig/blob/004763d9b581be9b6e13290a37622a891c9a1b80/index.js#L16

gulp.src(['./views/**/*.html'])
.pipe(twig({
            base: './views/',
            data: { tilte: 'sss'} // data
        }))

if I use the variable in one template, like this

{% set title = 'register' %}

ALL Template would be has data.title while equal to 'register'

https://www.npmjs.com/package/map-stream

change to

var data = file.data || Object.assign({}, options.data) || {};
This was referenced Oct 12, 2017
@icai icai changed the title data variable reference bug, should be a function? data variable reference bug Oct 13, 2017
@vastolf
Copy link

vastolf commented Oct 18, 2017

The fix for this in #45 is working, please take a look @zimmen

@bezoerb
Copy link
Collaborator

bezoerb commented Jan 15, 2018

https://github.com/zimmen/gulp-twig/releases/tag/v1.2.0

@bezoerb bezoerb closed this as completed Jan 15, 2018
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

3 participants