code: function renderPageTree(root, renderOpts) {
  
      renderOpts = u.assign({ openClass:'open' }, renderOpts);
  
      if (renderOpts.groupBy) {
        var folderPages =
          u.map(u.groupBy(root._children, renderOpts.groupBy), function(children, name) {
            if (name === 'undefined') { name = renderOpts.defaultGroup || ''; }
            return { folderPage: true,
                     _href:      name ? '/' + u.slugify(name) + '/' : '',
                     _children:  children,
                     name:       name };
          });
        return recurse(folderPages);
      }
      else return recurse(root._children);
  
      function recurse(children, pid) {
        pid = pid || renderOpts.pageTreeID || 'page-tree';
        var out = '\n<ul>';
  
        u.each(children, function(page) {
          var ppid = (pid + '-' + page._href).replace(/\W+/g, '-').replace(/^-|-$/g,'');
          out += '\n<li' + (page._children ? ' id="' + ppid + '" class="folder"' : '') + '>'
              + (page.folderPage ?
                ((page.name || page._href) ? '<span class="folderPage">' + (page.name || u.unslugify(page._href)) + '</span>' : '') :
                renderLink(u.assign({}, renderOpts, { href:page._href, title:(page.title || page.name) })))
              + (page._children ? recurse(page._children, ppid) : '')
              + '</li>';
        });
        return out + '\n</ul>';
      }
    }
docs: recursively build ul-li tree starting with root._children optionally groupBy top-level categories TODO: detect/avoid cycles