diff --git a/Sources/Generator/Content/Element.swift b/Sources/Generator/Content/Element.swift index 7c35a36..e3702cb 100644 --- a/Sources/Generator/Content/Element.swift +++ b/Sources/Generator/Content/Element.swift @@ -431,7 +431,7 @@ extension Element { // Find the common elements of the path, which can be discarded var index = 0 - while pageParts[index] == ownParts[index] { + while index < pageParts.count && index < ownParts.count && pageParts[index] == ownParts[index] { index += 1 } // The relative path needs to go down to the first common folder,