Skip to content

Instantly share code, notes, and snippets.

@cburgdorf
Last active December 16, 2015 18:59
Show Gist options
  • Save cburgdorf/5481792 to your computer and use it in GitHub Desktop.
Save cburgdorf/5481792 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.initConfig({
seo: {
site: 'index.html'
}
});
grunt.loadTasks('grunt-contrib-seo/tasks');
grunt.registerTask('default', ['seo']);
};
//var url = phantom.args[1];
var page = require('webpage').create();
var url = 'http://www.phantomjs.org/';
page.open(url, function (status) {
//grunt.log.write('wohooo page loaded');
//Page is loaded!
phantom.exit();
});
/*
* grunt-contrib-seo
*
* Copyright (c) 2013 Christoph Burgdorf, contributors
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
var fs = require("fs"),
path = require("path"),
phantom = require("grunt-lib-phantomjs").init(grunt);
grunt.registerMultiTask('seo','fetch html snapshots', function(){
debugger;
phantom.spawn('index.html', {
// Additional PhantomJS options.
options: {
phantomScript: "main.js"
},
// Complete the task when done.
done: function (err) {
grunt.log.write('wohooo done');
}
});
grunt.log.write('wohooo');
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment