This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Supplementary blacklist for PiHole | |
* Improves coverage on https://d3ward.github.io/toolz/adblock.html | |
**/ | |
[ | |
{ | |
"id": 3, | |
"type": 1, | |
"domain": "adtech.yahooinc.com", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delete CSS | |
gulp.task('clean:styles', function(callback) { | |
del([paths.jekyllCssFiles + 'main.css', | |
paths.siteCssFiles + 'main.css', | |
'_includes/critical.css' | |
]); | |
callback(); | |
}); | |
// Delete processed JS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run jekyll build command. | |
gulp.task('build:jekyll', function() { | |
var shellCommand = 'bundle exec jekyll build --config _config.yml'; | |
return gulp.src('') | |
.pipe(run(shellCommand)) | |
.on('error', gutil.log); | |
}); | |
// Special tasks for building and reloading BrowserSync | |
gulp.task('build:jekyll:watch', ['build:jekyll:local'], function(callback) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place fonts in proper location | |
gulp.task('build:fonts', function() { | |
return gulp.src(paths.fontFiles + '/**/**.*') | |
.pipe(rename(function(path) {path.dirname = '';})) | |
.pipe(gulp.dest(paths.jekyllFontFiles)) | |
.pipe(gulp.dest(paths.siteFontFiles)) | |
.pipe(browserSync.stream()) | |
.on('error', gutil.log); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optimize and copy image files | |
gulp.task('build:images', function() { | |
return gulp.src(paths.imageFilesGlob) | |
.pipe(imagemin({ | |
optimizationLevel: 3, | |
progressive: true, | |
interlaced: true, | |
use: [pngquant()] | |
})) | |
.pipe(gulp.dest(paths.jekyllImageFiles)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Concatenate and uglify global JS files and output the result to the | |
// appropriate location | |
gulp.task('build:scripts:global', function() { | |
return gulp.src([ | |
paths.jsFiles + '/lib' + paths.jsPattern, | |
paths.jsFiles + '/*.js' | |
]) | |
.pipe(concat('main.js')) | |
.pipe(uglify()) | |
.pipe(gulp.dest(paths.jekyllJsFiles)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create and process critical CSS file to be included in head | |
gulp.task('build:styles:critical', function() { | |
return sass(paths.sassFiles + '/critical.scss', { | |
style: 'compressed', | |
trace: true, | |
loadPath: [paths.sassFiles] | |
}).pipe(postcss([ autoprefixer({ browsers: ['last 2 versions'] }), cssnano()])) | |
.pipe(gulp.dest('_includes')) | |
.on('error', gutil.log); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Process styles, add vendor-prefixes, minify, then | |
// output the file to the appropriate location | |
gulp.task('build:styles:main', () => { | |
return sass(paths.sassFiles + '/main.scss', { | |
style: 'compressed', | |
trace: true, | |
loadPath: [paths.sassFiles] | |
}).pipe(postcss([autoprefixer({ browsers: ['last 2 versions']}), cssnano()])) | |
.pipe(gulp.dest(paths.jekyllCssFiles)) | |
.pipe(gulp.dest(paths.siteCssFiles)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gulpfile.js | |
const autoprefixer = require('autoprefixer'); | |
const browserSync = require('browser-sync').create(); | |
const concat = require('gulp-concat'); | |
const cssnano = require('cssnano'); | |
const del = require('del'); | |
const gulp = require('gulp'); | |
const gutil = require('gulp-util'); | |
const imagemin = require('gulp-imagemin'); | |
const pngquant = require('imagemin-pngquant'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var paths = {}; | |
// Directory locations. | |
paths.assetsDir = '_assets/'; // The files Gulp will handle. | |
paths.jekyllDir = ''; // The files Jekyll will handle. | |
paths.jekyllAssetsDir = 'assets/'; // The asset files Jekyll will handle. | |
paths.siteDir = '_site/'; // The resulting static site. | |
paths.siteAssetsDir = '_site/assets/'; // The resulting static site's assets. | |
// Folder naming conventions. | |
paths.postFolder = '_posts'; |
NewerOlder