var extend  = require("extend");
var path    = require("path");

var helpers = {};

// gets a path to another file based on the
// current files location
helpers.urlTo = function urlTo(file) {
  if (typeof file === "string") {
    return path.join(this.rootPath, file);
  }

  return path.join(this.rootPath, file.path.href);
};

// includes a partial files content
helpers.include = function include(name) {
  var file = this.allFiles[name] || {};
  return file.contents || "";
};

module.exports = function() {
  return function(files, metalsmith, done) {
    // expose all files to helpers
    helpers.allFiles = files;

    for (var file in files) {
      extend(files[file], helpers);
    }

    done();
  };
};

@@ -327,161 +327,8 @@
 %7D;%0A%0A
-// includes a partial files content%0Ahelpers.include = function include(name) %7B%0A  var file = this.allFiles%5Bname%5D %7C%7C %7B%7D;%0A  return file.contents %7C%7C %22%22;%0A%7D;%0A%0A
 modu
@@ -402,74 +402,8 @@
 ) %7B%0A
-    // expose all files to helpers%0A    helpers.allFiles = files;%0A%0A
     

remove old includes helper