{"size": 1548, "ext": "js", "max_stars_repo_path": "gulp/templates.js", "max_stars_repo_name": "DominikAngerer/typescript-google-maps", "max_stars_repo_stars_event_min_datetime": "2016-05-23T00:32:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-08T17:25:22.000Z", "max_issues_repo_path": "gulp/templates.js", "max_issues_repo_name": "DominikAngerer/typescript-google-maps", "max_issues_repo_issues_event_min_datetime": "2016-10-31T10:27:51.000Z", "max_issues_repo_issues_event_max_datetime": "2016-10-31T10:28:55.000Z", "max_forks_repo_path": "gulp/templates.js", "max_forks_repo_name": "DominikAngerer/typescript-google-maps", "max_forks_repo_forks_event_min_datetime": "2016-05-25T06:42:26.000Z", "max_forks_repo_forks_event_max_datetime": "2017-01-17T00:02:32.000Z"}
{"max_stars_count": 15, "max_issues_count": 1, "max_forks_count": 2, "avg_line_length": 31.5918367347, "max_line_length": 79, "alphanum_fraction": 0.600129199}
var gulp = require('gulp');
var assemble = require('assemble');
var gulpAssemble = require('gulp-assemble');
var extname = require('gulp-extname');
var config = require('./config');
var htmlmin = require('gulp-html-minifier');
var plumber = require('gulp-plumber');
var util = require('gulp-util');
var gulpif = require('gulp-if');
var argv = require('yargs').argv;
var wrap = require('gulp-wrap');
var concat = require('gulp-concat');
var declare = require('gulp-declare');
var trim = require('gulp-trim');

gulp.task('templates', function() {

    var isProduction = (typeof argv.production !== 'undefined') ? true : false;

    assemble.data({
        site: {
            title: 'Index'
        }
    });
    assemble.data([config.src.data + '/*.{json,yml}']);
    assemble.layouts([config.src.templates + '/layouts/*.hbs']);
    assemble.partials([config.src.templates + '/components/**/*.hbs']);
   
    gulp.src(config.src.templates + '/pages/*.hbs')
        .pipe(plumber(function(error) {
            util.log(util.colors.red(error.message));
            this.emit('end');
        }))
        .pipe(gulpAssemble(assemble, {
            layout: 'default'
        }))
        .pipe(gulpif(isProduction, htmlmin({
            collapseWhitespace: true
        })))
        .pipe(extname())
        .pipe(gulp.dest(config.dest.templates));

});

gulp.task('templates:watch', function() {
    gulp.watch(config.src.templates + '/**/*.{hbs,yaml,json}', ['templates']);
    gulp.watch(config.src.data + '/**/*.{hbs,yaml,json}', ['templates']);
});
