@@ -434,8 +434,8 @@ struct PathHierarchy {
434434 /// - Returns: The node to start the relative search relative to.
435435 private func findRoot( parentID: ResolvedIdentifier ? , remaining: inout ArraySlice < PathComponent > , isAbsolute: Bool , onlyFindSymbols: Bool ) throws -> Node {
436436 // If the first path component is "tutorials" or "documentation" then that
437- let isKnownTutorialPath = remaining. first!. full == " tutorials "
438- let isKnownDocumentationPath = remaining. first!. full == " documentation "
437+ let isKnownTutorialPath = remaining. first!. full == NodeURLGenerator . Path . tutorialsFolderName
438+ let isKnownDocumentationPath = remaining. first!. full == NodeURLGenerator . Path . documentationFolderName
439439 if isKnownDocumentationPath || isKnownTutorialPath {
440440 // Drop that component since it isn't represented in the path hierarchy.
441441 remaining. removeFirst ( )
@@ -626,7 +626,9 @@ extension PathHierarchy {
626626 static func parse( path: String ) -> ( components: [ PathComponent ] , isAbsolute: Bool ) {
627627 guard !path. isEmpty else { return ( [ ] , true ) }
628628 var components = path. split ( separator: " / " , omittingEmptySubsequences: true )
629- let isAbsolute = path. first == " / " || components. first == " documentation " || components. first == " tutorials "
629+ let isAbsolute = path. first == " / "
630+ || String ( components. first ?? " " ) == NodeURLGenerator . Path. documentationFolderName
631+ || String ( components. first ?? " " ) == NodeURLGenerator . Path. tutorialsFolderName
630632
631633 if let hashIndex = components. last? . firstIndex ( of: " # " ) {
632634 let last = components. removeLast ( )
0 commit comments