<commit_before>var gulp        = require('gulp');
var browserSync = require('browser-sync');
var sass        = require('gulp-sass');
var prefix      = require('gulp-autoprefixer');
var cssnano 	= require('gulp-cssnano');
var concat      = require('gulp-concat');
var uglify      = require('gulp-uglify');
var favicons    = require('gulp-favicons');
var imagemin    = require('gulp-imagemin');
var size        = require('gulp-size');
var argv        = require('yargs').argv;
var htmlmin     = require('gulp-htmlmin');
var shell       = require('shelljs');
// var optipng     = require('imagemin-')

var messages = {
    jekyllBuild: '<span style="color: grey">Running:</span> $ jekyll build'
};

// Set the path variables
var paths = {};

paths.assetsSourceFolder = '_assets/'
paths.assetsOutputFolder = 'assets/'
paths.sassFolder = 'sass/'
paths.jsFolder = 'js/'
paths.imageFolder = 'img/'
paths.sourceFolder = ''

paths.sassFiles = paths.assetsSourceFolder + paths.sassFolder
paths.jsFiles = paths.assetsSourceFolder + paths.jsFolder
paths.imageFiles = paths.assetsSourceFolder + paths.imageFolder
paths.sassFilesOutput = paths.assetsOutputFolder + 'css/'
paths.jsFilesOutput = paths.assetsOutputFolder + paths.jsFolder
paths.imageFilesOutput = paths.assetsOutputFolder + paths.imageFolder

// Glob patterns by file type.
paths.sassPattern        = '**/*.scss';
paths.jsPattern          = '**/*.js';
paths.imagePattern       = '**/*.+(jpg|JPG|jpeg|JPEG|png|PNG|svg|SVG|gif|GIF|webp|WEBP|tif|TIF)';
paths.htmlPattern        = '**/*.html';

// File globs
paths.imageFilesGlob     = paths.imageFiles + paths.imagePattern
paths.jsFilesGlob        = paths.jsFiles + paths.jsPattern
paths.sassFilesGlob      = paths.sassFiles + paths.sassPattern

paths.jekyll =  ['index.html', '_config.yml', '_config.dev.yml', '_posts/*','_pages/*', '_layouts/*', '_includes/*']


/**
 * Build the Jekyll Site
 */
gulp.task('jekyll-build', function (done) {
    if (!argv.prod) {
        browserSync.notify(messages.jekyllBuild);
        shell.exec('bundle exec jekyll build --config _config.yml,_config.dev.yml')
        done();
        // return cp.spawn( jekyll , ['build', '--config', '_config.yml,_config.dev.yml'], {stdio: 'inherit'})
        //     .on('close', done);
    } else if (argv.prod) {
        shell.exec('JEKYLL_ENV=production bundle exec jekyll build')
        done();
    }
});

// 'gulp html' -- does nothing
// 'gulp html --prod' -- minifies and gzips HTML files for production
gulp.task('html', ['jekyll-build'], function() {
    if (argv.prod) {
        return gulp.src('_site/' + paths.htmlPattern)
            .pipe(htmlmin({
              removeComments: true,
              collapseWhitespace: true,
              collapseBooleanAttributes: false,
              removeAttributeQuotes: false,
              removeRedundantAttributes: false,
              minifyJS: true,
              minifyCSS: true
            }))
            .pipe(size({title: 'optimized HTML'}))
            .pipe(gulp.dest('_site/'));
    }
});

/**
 * Rebuild Jekyll & do page reload
 */
gulp.task('jekyll-rebuild', ['html'], function () {
    browserSync.reload();
});

/**
 * Wait for jekyll-build, then launch the Server
 */
gulp.task('build', ['sass', 'jquery', 'plugins-js', 'js', 'images', 'html'], function () {<commit_msg>don't collapse whitespace when minifying html<commit_after>var gulp        = require('gulp');
var browserSync = require('browser-sync');
var sass        = require('gulp-sass');
var prefix      = require('gulp-autoprefixer');
var cssnano 	= require('gulp-cssnano');
var concat      = require('gulp-concat');
var uglify      = require('gulp-uglify');
var favicons    = require('gulp-favicons');
var imagemin    = require('gulp-imagemin');
var size        = require('gulp-size');
var argv        = require('yargs').argv;
var htmlmin     = require('gulp-htmlmin');
var shell       = require('shelljs');
// var optipng     = require('imagemin-')

var messages = {
    jekyllBuild: '<span style="color: grey">Running:</span> $ jekyll build'
};

// Set the path variables
var paths = {};

paths.assetsSourceFolder = '_assets/'
paths.assetsOutputFolder = 'assets/'
paths.sassFolder = 'sass/'
paths.jsFolder = 'js/'
paths.imageFolder = 'img/'
paths.sourceFolder = ''

paths.sassFiles = paths.assetsSourceFolder + paths.sassFolder
paths.jsFiles = paths.assetsSourceFolder + paths.jsFolder
paths.imageFiles = paths.assetsSourceFolder + paths.imageFolder
paths.sassFilesOutput = paths.assetsOutputFolder + 'css/'
paths.jsFilesOutput = paths.assetsOutputFolder + paths.jsFolder
paths.imageFilesOutput = paths.assetsOutputFolder + paths.imageFolder

// Glob patterns by file type.
paths.sassPattern        = '**/*.scss';
paths.jsPattern          = '**/*.js';
paths.imagePattern       = '**/*.+(jpg|JPG|jpeg|JPEG|png|PNG|svg|SVG|gif|GIF|webp|WEBP|tif|TIF)';
paths.htmlPattern        = '**/*.html';

// File globs
paths.imageFilesGlob     = paths.imageFiles + paths.imagePattern
paths.jsFilesGlob        = paths.jsFiles + paths.jsPattern
paths.sassFilesGlob      = paths.sassFiles + paths.sassPattern

paths.jekyll =  ['index.html', '_config.yml', '_config.dev.yml', '_posts/*', '_drafts/*', '_pages/*', '_layouts/*', '_includes/*']


/**
 * Build the Jekyll Site
 */
gulp.task('jekyll-build', function (done) {
    if (!argv.prod) {
        browserSync.notify(messages.jekyllBuild);
        shell.exec('bundle exec jekyll build --drafts --config _config.yml,_config.dev.yml')
        done();
        // return cp.spawn( jekyll , ['build', '--config', '_config.yml,_config.dev.yml'], {stdio: 'inherit'})
        //     .on('close', done);
    } else if (argv.prod) {
        shell.exec('JEKYLL_ENV=production bundle exec jekyll build')
        done();
    }
});

// 'gulp html' -- does nothing
// 'gulp html --prod' -- minifies and gzips HTML files for production
gulp.task('html', ['jekyll-build'], function() {
    if (argv.prod) {
        return gulp.src('_site/' + paths.htmlPattern)
            .pipe(htmlmin({
              removeComments: true,
              collapseWhitespace: false,
              collapseBooleanAttributes: false,
              removeAttributeQuotes: false,
              removeRedundantAttributes: false,
              minifyJS: true,
              minifyCSS: true
            }))
            .pipe(size({title: 'optimized HTML'}))
            .pipe(gulp.dest('_site/'));
    }
});

/**
 * Rebuild Jekyll & do page reload
 */
gulp.task('jekyll-rebuild', ['html'], function () {
    browserSync.reload();
});

/**
 * Wait for jekyll-build, then launch the Server
 */
gulp.task('build', ['sass', 'jquery', 'plugins-js', 'js', 'images', 'html'], function () {
{'fraction_non_alphanumeric': 0.162874251497006, 'fraction_numerical': 0.0, 'mean_word_length': 3.0837408312958434, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3454619', 'n_tokens_mistral': 2142, 'n_tokens_neox': 2100, 'n_words': 442}