<commit_before>'use strict';

/**
 * todo
 *
 * hb layouts
 * hb data
 * hb helper
 *
 * CSSLint
 * CSS Uglify
 * CSS Specificity Graph Generator
 * SassDoc
 * https://github.com/anandthakker/doiuse
 *
 * Images
 * gulp-imagemin
 * imagemin-mozjpeg
 * imagemin-optipng
 * imagemin-pngquant
 *
 */

var gulp = require('gulp-help')(require('gulp'), {
    description: 'Display this help text for the gulp tasks.',
    aliases: ['h'],
    hideEmpty: true,
    hideDepsMessage: true
  }),
  browserSync = require('browser-sync').create(),
  htmlInjector = require("bs-html-injector"),
  argv = require('yargs').argv,
  del = require('del'),
  hb = require('gulp-hb'),
  sass = require('gulp-sass'),
  sourcemaps = require('gulp-sourcemaps'),
  autoprefixer = require('gulp-autoprefixer'),
  rename = require("gulp-rename"),
  runSequence = require('run-sequence'),
  cssnano = require('gulp-cssnano'),
  htmlmin = require('gulp-htmlmin'),
  concat = require('gulp-concat'),
  uglify = require('gulp-uglify'),
  gulpif = require('gulp-if'),
  access = require('gulp-accessibility'),
  eslint = require('gulp-eslint'),
  inlineSource = require('gulp-inline-source');


const path = require('path'),
  glob = require('glob');

var buildDirectory,
  isProduction = false;


/**
 * clean
 *
 * Delete output directory.
 * ========================================================================== */

gulp.task('build:clean', function () {
  return del([buildDirectory]);
});


/**
 * copy
 *
 *
 * ========================================================================== */

gulp.task('build:copy', function () {
  return gulp.src(['./src/**/*', '!./src/**/_*', '!./src/**/*.hbs', '!./src/styles/**/*.scss', '!./src/scripts/**/*.js'])
    .pipe(gulp.dest(buildDirectory))
});


/**
 * handlebars
 *
 * build templates: Compile handlebars templates
 * ========================================================================== */

gulp.task('build:handlebars', function () {
  return gulp.src(['./src/**/*.hbs', '!./src/_*/**'])
    .pipe(hb({
      partials: './src/_templates/_partials/**/*.hbs'
    }))
    .pipe(htmlmin({
      removeComments: true,
      collapseWhitespace: true,
      collapseBooleanAttributes: true,
      removeAttributeQuotes: true,
      removeRedundantAttributes: true,
      removeOptionalTags: false, // todo: true for PROD
      caseSensitive: true
    }))
    .pipe(rename({extname: '.html'}))<commit_msg>activated removeOptionalTags in HTML minification for `production` gulp task<commit_after>'use strict';

/**
 * todo
 *
 * hb layouts
 * hb data
 * hb helper
 *
 * CSSLint
 * CSS Uglify
 * CSS Specificity Graph Generator
 * SassDoc
 * https://github.com/anandthakker/doiuse
 *
 * Images
 * gulp-imagemin
 * imagemin-mozjpeg
 * imagemin-optipng
 * imagemin-pngquant
 *
 */

var gulp = require('gulp-help')(require('gulp'), {
    description: 'Display this help text for the gulp tasks.',
    aliases: ['h'],
    hideEmpty: true,
    hideDepsMessage: true
  }),
  browserSync = require('browser-sync').create(),
  htmlInjector = require("bs-html-injector"),
  argv = require('yargs').argv,
  del = require('del'),
  hb = require('gulp-hb'),
  sass = require('gulp-sass'),
  sourcemaps = require('gulp-sourcemaps'),
  autoprefixer = require('gulp-autoprefixer'),
  rename = require("gulp-rename"),
  runSequence = require('run-sequence'),
  cssnano = require('gulp-cssnano'),
  htmlmin = require('gulp-htmlmin'),
  concat = require('gulp-concat'),
  uglify = require('gulp-uglify'),
  gulpif = require('gulp-if'),
  access = require('gulp-accessibility'),
  eslint = require('gulp-eslint'),
  inlineSource = require('gulp-inline-source');


const path = require('path'),
  glob = require('glob');

var buildDirectory,
  isProduction = false;


/**
 * clean
 *
 * Delete output directory.
 * ========================================================================== */

gulp.task('build:clean', function () {
  return del([buildDirectory]);
});


/**
 * copy
 *
 *
 * ========================================================================== */

gulp.task('build:copy', function () {
  return gulp.src(['./src/**/*', '!./src/**/_*', '!./src/**/*.hbs', '!./src/styles/**/*.scss', '!./src/scripts/**/*.js'])
    .pipe(gulp.dest(buildDirectory))
});


/**
 * handlebars
 *
 * build templates: Compile handlebars templates
 * ========================================================================== */

gulp.task('build:handlebars', function () {
  return gulp.src(['./src/**/*.hbs', '!./src/_*/**'])
    .pipe(hb({
      partials: './src/_templates/_partials/**/*.hbs'
    }))
    .pipe(htmlmin({
      removeComments: true,
      collapseWhitespace: true,
      collapseBooleanAttributes: true,
      removeAttributeQuotes: true,
      removeRedundantAttributes: true,
      removeOptionalTags: !!isProduction,
      caseSensitive: true
    }))
    .pipe(rename({extname: '.html'}))
{'fraction_non_alphanumeric': 0.2657299938912645, 'fraction_numerical': 0.0, 'mean_word_length': 4.012244897959183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '166602', 'n_tokens_mistral': 1594, 'n_tokens_neox': 1533, 'n_words': 281}