/*
 * PAGES: Downloads rendered pages from a Bolt server
 */
module.exports = function (grunt) {
    grunt.registerTask('pages', 'Downloads rendered pages from a Bolt server', function () {
        var outpath;

        // Require config variables.
        grunt.config.requires(
            'path.tmp'
        );

        // Create output directory inside tmp folder.
        outpath = grunt.config('path.tmp') + '/pages';
        grunt.file.mkdir(outpath);
    });
};

@@ -202,16 +202,98 @@
  outpath
+,%0A            outfile,%0A            baseurl,%0A            pages,%0A            options
 ;%0A%0A     
@@ -377,16 +377,75 @@
 ath.tmp'
+,%0A            'pages.baseurl',%0A            'pages.requests'
 %0A       
@@ -592,16 +592,850 @@
 utpath);
+%0A%0A        // Request all required pages.%0A        pages = grunt.config('pages.requests');%0A        for (var dest in pages) %7B%0A            // Set request options.%0A            if (typeof pages%5Bdest%5D === 'object') %7B%0A                options = pages%5Bdest%5D;%0A            %7D else %7B%0A                options = %7B%0A                    url: pages%5Bdest%5D !== '' ? pages%5Bdest%5D : dest%0A                %7D;%0A            %7D%0A            options.baseUrl = options.baseUrl %7C%7C grunt.config('pages.baseurl');%0A%0A            // Path, where to put the file. Make it always end with %22.html%22%0A            outfile = outpath + '/' + dest.replace(/%5E(.+)%5C.html$/, '$1') + '.html';%0A%0A            // Some verbose output.%0A            grunt.verbose.writeln('Get page %22' + outfile + '%22:');%0A            grunt.verbose.writeln(require('util').inspect(options, false, 2, true));%0A        %7D
 %0A    %7D);

Build request options for required pages