function writeFile(outputFile, content, options) {
    return renderContent(content, options)
    .then(function(output) {
      return fsWriteFile(outputFile, output);
    });
  }
', '!./node_modules', '!./node_modules/**'];
var recipeSlugs = glob.sync('./!(dist|node_modules|src|_recipe_template|imgs)/').map(function toBase(dir) {
  return path.basename(dir);
});
var srcRecipes = recipeSlugs.map(function makePath(name) {
  return './' + name + '/**';
});
var recipes = parseRecipes.parse(recipeSlugs);

var template = (function() {
  function renderContent(content, options) {
    var newOptions = options || {};
    return renderFile('./src/tpl/layout.html', {
      content: content,
      package: require('./package.json'),
      recipes: recipes,
      ghBase: 'https://github.com/digitarald/serviceworker-cookbook/blob/master/',
      currentRecipe: newOptions.currentRecipe,
      categories: parseRecipes.categories
    });
  }

  /**
Write content into the layout file.
@param {string} outputFile - filename
@param {string} content - put in the main body, NOT ESCAPED
@param {Object} options -
   'currentRecipe' - if the page needs the recipe's header
@returns {Promise}