 # it is exposed, so that it can expose accurate link information. Accessor
 # properties are used because the structure is circular so we need some
 # laziness.
-navInContext = (nav, context) ->
+navInContext = (nav, context, root) ->
   Object.defineProperties
     title: nav.title
     # how you get here from there, but only if here is an actual place

      current.title = title ? current.title # overwrite defaults with non-nulls
      current.order = order ? current.order
      # use leaf to make the nav object
      nav = navInContext current, [path]
      # set properties of vinyl object XXX does this need error handling?
      for target in targets
        obj = file

      transformCallback()
    , (flushCallback) ->                   # (still in the call to through.obj)
      for name, child of navTree.children                    # there's only one
        root.obj = child
        root.name = name
      if demoteTopIndex       # top-level index becomes sibling of its children
        for name, child of root.obj.children
          navTree.children[resolve root.name, name] = child
          child.parent = navTree
        root.obj.children = {}
      # ...and now we've seen them all
      @push file for file in files
      flushCallback()
