@@ -434,8 +434,8 @@ struct PathHierarchy {
434
434
/// - Returns: The node to start the relative search relative to.
435
435
private func findRoot( parentID: ResolvedIdentifier ? , remaining: inout ArraySlice < PathComponent > , isAbsolute: Bool , onlyFindSymbols: Bool ) throws -> Node {
436
436
// 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
439
439
if isKnownDocumentationPath || isKnownTutorialPath {
440
440
// Drop that component since it isn't represented in the path hierarchy.
441
441
remaining. removeFirst ( )
@@ -626,7 +626,9 @@ extension PathHierarchy {
626
626
static func parse( path: String ) -> ( components: [ PathComponent ] , isAbsolute: Bool ) {
627
627
guard !path. isEmpty else { return ( [ ] , true ) }
628
628
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
630
632
631
633
if let hashIndex = components. last? . firstIndex ( of: " # " ) {
632
634
let last = components. removeLast ( )
0 commit comments