old_contents: var gulp         = require('gulp'),
      autoprefixer = require('gulp-autoprefixer'),
      browserSync  = require('browser-sync').create(),
      htmlmin      = require('gulp-htmlmin'),
      nunjucks     = require('gulp-nunjucks-render'),
      sass         = require('gulp-sass'),
      sourcemaps   = require('gulp-sourcemaps'),
      projectData  = require('./source/data/projects.json');
  
  gulp.task('build-html', function() {
    return gulp.src('source/html/*.html')
      .pipe(nunjucks({
        data: projectData
      }))
      .pipe(htmlmin({
        collapseBooleanAttributes: true,
        collapseWhitespace: true,
        conservativeCollapse: true, // required for browser-sync to work
        decodeEntities: true,
        includeAutoGeneratedTags: false,
        minifyCSS: true,
        minifyJS: true,
        processConditionalComments: true,
        processScripts: ['text/html'],
        quoteCharacter: '"',
        removeComments: true,
        removeEmptyAttributes: true,
        removeRedundantAttributes: true,
        removeScriptTypeAttributes: true,
        removeStyleLinkTypeAttributes: true,
        useShortDoctype: true
      }))
      .pipe(gulp.dest('public'));
  });
  
  gulp.task('build-css', function() {
    return gulp.src('source/scss/*.scss')
      .pipe(sourcemaps.init())
      .pipe(sass({
        outputStyle: 'compressed'
      }).on('error', sass.logError))
      .pipe(autoprefixer())
      .pipe(sourcemaps.write('./sourcemaps'))
      .pipe(gulp.dest('public/assets/stylesheets'));
  });
  
  gulp.task('sync-html', ['build-html'], function() {
    browserSync.reload();
  });
  
  gulp.task('sync-css', ['build-css'], function() {
    browserSync.reload();
  });
  
  gulp.task('watch', function() {
    browserSync.init({
      server: {
        baseDir: 'public'
      }
    });
  
    gulp.watch('source/scss/*.scss', ['sync-css']);
    gulp.watch(['source/html/*.html', 'source/templates/*.html',
      'source/data/*.json'], ['sync-html']);
  });
  
  gulp.task('build', ['build-html', 'build-css']);
  gulp.task('default', ['build', 'watch']);
  
new_contents: var gulp         = require('gulp'),
      autoprefixer = require('gulp-autoprefixer'),
      browserSync  = require('browser-sync').create(),
      fs           = require('fs'),
      htmlmin      = require('gulp-htmlmin'),
      nunjucks     = require('gulp-nunjucks-render'),
      sass         = require('gulp-sass'),
      sourcemaps   = require('gulp-sourcemaps');
  
  gulp.task('build-html', function() {
    var projectData = JSON.parse(fs.readFileSync('./source/data/projects.json'));
    return gulp.src('source/html/*.html')
      .pipe(nunjucks({ data: projectData }))
      .pipe(htmlmin({
        collapseBooleanAttributes: true,
        collapseWhitespace: true,
        conservativeCollapse: true, // required for browser-sync to work
        decodeEntities: true,
        includeAutoGeneratedTags: false,
        minifyCSS: true,
        minifyJS: true,
        processConditionalComments: true,
        processScripts: ['text/html'],
        quoteCharacter: '"',
        removeComments: true,
        removeEmptyAttributes: true,
        removeRedundantAttributes: true,
        removeScriptTypeAttributes: true,
        removeStyleLinkTypeAttributes: true,
        useShortDoctype: true
      }))
      .pipe(gulp.dest('public'));
  });
  
  gulp.task('build-css', function() {
    return gulp.src('source/scss/*.scss')
      .pipe(sourcemaps.init())
      .pipe(sass({
        outputStyle: 'compressed'
      }).on('error', sass.logError))
      .pipe(autoprefixer())
      .pipe(sourcemaps.write('./sourcemaps'))
      .pipe(gulp.dest('public/assets/stylesheets'));
  });
  
  gulp.task('sync-html', ['build-html'], function() {
    browserSync.reload();
  });
  
  gulp.task('sync-css', ['build-css'], function() {
    browserSync.reload();
  });
  
  gulp.task('watch', function() {
    browserSync.init({
      server: {
        baseDir: 'public'
      }
    });
  
    gulp.watch('source/scss/*.scss', ['sync-css']);
    gulp.watch(['source/html/*.html', 'source/templates/*.html',
      'source/data/*.json'], ['sync-html']);
  });
  
  gulp.task('build', ['build-html', 'build-css']);
  gulp.task('default', ['build', 'watch']);
  
subject: Allow live reloading of projects data