code: async function getNestedPages(folder) {
    config = config || (await asyncConfig());
  
    const items = await globby(['*', '!_*', '!pattern-lab'], {
      cwd: folder,
      onlyFiles: false,
    });
  
    return Promise.all(
      items.map(async item => {
        const fullPath = path.join(folder, item);
        const stats = await lstat(fullPath);
        if (stats.isDirectory()) {
          const indexFile = path.join(fullPath, '00-index.md'); // @todo Make this work with `00-index.html`, `01-index.md`, `index.md`, or `index.html`
          const children = await getNestedPages(fullPath);
          // The children include the `indexFile` as well, so let's remove it.
          const filterChildren = children.filter(
            child => indexFile !== child.srcPath,
          );
          let item;
          try {
            item = await getPage(indexFile);
          } catch (error) {
            log.error(
              `Each folder in static site content must contain a file called "00-index.md", please make one here: ${indexFile}`,
            );
            process.exit(1); // exiting immediately so follow up error messages don't confuse user.
          }
          item.children = filterChildren;
          return item;
        } else {
          return await getPage(fullPath);
        }
      }),
    );
  }
docs: Recursively crawl a directory and subdirectory to build a nested content object.
  Returns an object that reflects directory structure and contains html and
  markdown file information generated by getPage().
  
  How this function works:
  If the folder passed in is for a directory, it will run `getPage()` for the "index" file inside,
  then also get info on all children all contents of that directory.
  
  @param {string} folder A system path to a directory
  @returns {Promise<object[]>}