const Gulp = require('gulp');
const Pug = require('gulp-pug');
const Fs = require('fs');
const dataFromFile = JSON.parse(Fs.readFileSync('./data.json'))
// Pug to HTML
Gulp.task('pug', () =>
Gulp.src('./*.pug')
.pipe(Pug({
pretty: true,
locals: dataFromFile || {}
}))
.pipe(Gulp.dest('./build'))
);
{
"sections": {
"html": {
"name": "HTML",
"color": "#e44d26"
}
}
}
.test= sections.html.color
.test #{sections.html.color}