code: function resolvePath(metalsmith) {
      var globStart = false;                            // Indicator, if globbing pattern was found yet
      var cwd = metalsmith.directory();                 // Get Metalsmith working directory
      var subPath = [];
      var pattern = [];
      var directory = dir.split('/');
      directory.forEach(function parsePathElems(elem) {
        if (globStart || elem.search(/[^a-z0-9\.\-_]/gi) >= 0) {   // Search in current path segment for glob patterns
          globStart = true;                 // If true, set globStart to true
          return pattern.push(elem);        // add to pattern now and in future automatically
        }
        return subPath.push(elem);
      });
  
      // Now check if calculated path is existing (absolute vs relative position to Metalsmith CWD)
      var localPath = path.resolve(cwd, subPath.join('/'));   // Assume path is relative to CWD, e.g. ./src/*.json
      if (!fs.existsSync(path.resolve(cwd, localPath))) {
        localPath = path.relative(cwd, subPath.join('/'));    // Assumption false, it was absolute, e.g. ./test/fixtures/...
      }
  
      return path.resolve(cwd, localPath, pattern.join('/')); // return correct path
    }
docs: /*
  Fix for resolving local path
  @param {Metalsmith} metalsmith The metalsmith instance
  @returns The absolute path including initial globbing pattern