Questions tagged [gulp-data]

Used in cases when gulp plugin accepts JSON as one of the input parameters. Then gulp-data could be used to actually create a data, pipe it and hide an access method (database, file system etc.)

https://github.com/colynb/gulp-data#readme

9 questions
7
votes
1 answer

Data from Mongo in Gulp using Gulp Data

How can I get data from my Mongo database to pipe in Gulp as a data source when using Gulp Data? Gulp Task (simplified) gulp.task('db-test', function() { return gulp.src('./examples/test3.html') .pipe(data(function(file, cb) { …
Scott Simpson
  • 3,832
  • 3
  • 27
  • 35
2
votes
1 answer

Gulp task to merge JSON and Handlebars from partials into HTML

I'm making a simple proof-of-concept website using JSON as a data source and Handlebars for a templating engine, with a view to 'merging' the two things into a static HTML file. The website will be very modular, so each component will be built using…
Dan
  • 5,836
  • 22
  • 86
  • 140
1
vote
1 answer

pug/jade & gulp-merge-json line break

I'm using pug/jade with gulp data & gulp-merge-json. I can't find a way to insert line break in my Json. I have tried to insert in the json : \n \" \\ \/ \b \f \r \u None works. I managed to have a space using \t, but I really need to be able to…
Rom
  • 109
  • 2
  • 13
1
vote
0 answers

Cannot get posts from MongoDB using gulp-data

Approach: Use gulp to create static html with posts from mongodb Stack:: express, mongodb, pug, gulp TL:DR I have a express app with connected mongodb and a few posts which are displayed on my landingpage. Per server everything works, it also runs…
spielhoelle
  • 29
  • 1
  • 7
1
vote
1 answer

Multiple Nunjucks files with different JSON data using gulp

I would like to use gulp and Nunjucks to generate multiple template files at once with varying content. These templates will all have the exact same layout, but pass in different variables for text/images. I am able to successfully generate a single…
Morgan
  • 574
  • 9
  • 28
0
votes
1 answer

how do I access json from gulp data in nunjucks?

I have a some.json file like this: { "disneyland-paris": { "lang": "de" }, "hanoi": { "lang": "de" } } … that I want to get into a nunjucks template with: pipe(data(function() { return…
j____r___
  • 95
  • 1
  • 6
0
votes
1 answer

Splice path with Gulp-data

How do I get the name of the parent folder using gulp-data? Currently I'm using the following: In my front matter --- title: 'some title' ---- from my gulp file: function fm2json() { return gulp.src('src/pages/**/*.html') …
user2816197
0
votes
1 answer

JSON data in nunjucks templating, using gulp-data

I would like to use JSON data inside of nunjucks "set". A minimal example: index.html {% set divname='foo' %} {% include 'template.nunjucks' %} template.nunjucks
Which works great. I would like to move data, for…
KayakinKoder
  • 3,243
  • 3
  • 23
  • 37
0
votes
1 answer

How to get output html in different language using gulp-data?

This is my gulp file var gulp = require('gulp'); var posthtml = require('gulp-posthtml'); var mjml = require('gulp-mjml'); var nunjucksRender = require('gulp-nunjucks-render'); var data = require('gulp-data'); gulp.task('html', function() { var…
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852