We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Install gulp-data: npm i -D gulp-data
npm i -D gulp-data
In the gulpfile.babel import the module and the data you want to pass to the templates.
import data from 'gulp-data'; import jsonData from './src/path/to/json';
Edit the nunjucks task to add the data
gulp.task('nunjucks', () => { // Gets .html and .nunjucks files in pages return gulp.src(src.nunjucks) // Adding data to Nunjucks .pipe(data(function() { return jsonData; })) // Renders template with nunjucks .pipe(nunjucksRender({ path: [src.templates] })) // output files in app folder .pipe(gulp.dest(src.root)); });
The text was updated successfully, but these errors were encountered:
i dont care.
Sorry, something went wrong.
Nice!! Thanks! @Marcotss Grow up! :D
No branches or pull requests
Install gulp-data:
npm i -D gulp-data
In the gulpfile.babel import the module and the data you want to pass to the templates.
Edit the nunjucks task to add the data
The text was updated successfully, but these errors were encountered: