       # ...and now we've seen them all
       @push file for file in files
       flushCallback()
-
-navTree =
-  parent: null
-  children: {}
-  exists: no
-  title: null
-
-orderGen = 9999
-
-insertNavIntoTree = (relativePath, extension, title, order) ->
-  _path = path.resolve '/', relativePath
-    .replace /index\.[^/]+$/, ''              # index identified with directory
-    .replace /\.[^./]+$/, '.' + extension     # e.g. '.jade' -> '.html'
-    .split /([^/]*\/)/                        # e.g. '/a/b' -> ['/', 'a/', 'b']
-    .filter (element) -> element isnt ''
-  current = navTree
-  for element in _path
-    current = current.children[element] ?=   # recurse down, filling in missing
-      parent: current
-      children: {}
-      exists: no                             # for directories without an index
-      title: path.basename element.replace /\/?index[^/]*$/, ''
-        .toLowerCase()
-        .replace /\.[^.]*$/, ''                        # remove extension
-        .replace /(?:^|[-._])[a-z]/g, (first) ->
-          first.toUpperCase()                          # capitalize each word
-        .replace /[-._]/g, ' '                         # punctuation to spaces
-        .replace /^$/, '/'                             # root needs a title too
-      order: orderGen++
-  current.exists = yes             # if we're here, this resource *does* exist!
-  current.title = title ? current.title     # overwrite defaults with non-nulls
-  current.order = order ? current.order
-  navInContext current, [_path.join '']
 
 # Create the actual nav object that will be exposed to user code. This object
 # knows (and the objects that it creates, in turn, know) the context in which

    orders  = [ orders ]  unless Array.isArray orders
    skips   = [ skips ]   unless Array.isArray orders

    files = []

    through (file, encoding, transformCallback) ->
      # if vinyl objects have different properties, take first that exists
      source = (file[source] for source in sources).reduce (x, y) -> x ?= y
      source ?= file  # just look for title and order on the vinyl obj itself
      for skip in skips
        if skip of source and source[skip]
          @push file
          return transformCallback()
      title = (source[title] for title in titles).reduce (x, y) -> x ?= y
      order = (source[order] for order in orders).reduce (x, y) -> x ?= y
      # insert new nav into the tree
      nav = insertNavIntoTree file.relative, hrefExtension, title, order
      # set properties of vinyl object XXX does this need error handling?
      for target in targets
        obj = file

      get: ->
        (navInContext child, context.concat name for [child, name] in (
          [child, name] for name, child of nav.children)
            .sort ([a, ...], [b, ...]) -> a.order - b.order)
    siblings:
      enumerable: yes
      get: ->
