Skip to content

Instantly share code, notes, and snippets.

@tjFogarty
Created September 19, 2014 11:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjFogarty/15ebb77552f782387f73 to your computer and use it in GitHub Desktop.
Save tjFogarty/15ebb77552f782387f73 to your computer and use it in GitHub Desktop.
Penthouse - gulp
var penthouse = require('penthouse');
var fs = require('fs');
var cleanCSS = require('clean-css');
gulp.task('penthouse', ['styles'], function () {
penthouse({
url: ['http://chadwicks.dev'],
css: 'assets/css/application.css',
width: 480,
height: 800
}, function (err, critical) {
var clean = new cleanCSS().minify(critical);
fs.writeFile('admin/templates/default_site/layouts.group/critical.html', '<style>' + clean + '</style>');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment