Okay, NOW it should work
authorLanius Trolling <lanius@laniustrolling.dev>
Tue, 23 Apr 2024 19:13:44 +0000 (15:13 -0400)
committerLanius Trolling <lanius@laniustrolling.dev>
Tue, 23 Apr 2024 19:13:44 +0000 (15:13 -0400)
src/jvmMain/kotlin/info/mechyrdia/lore/ViewsLore.kt

index 9bed60d3bb964822aa0ed110abb960847dba4f07..699bc1122e24e0a706c4b35db0cf792cbc5cac11 100644 (file)
@@ -67,12 +67,9 @@ suspend fun ApplicationCall.loreRawArticlePage(pagePath: List<String>): HTML.()
        
        val parentPaths = if (pagePath.isEmpty())
                emptyList()
-       else {
-               val pathDirs = pagePath.dropLast(1)
-               listOf(Root.LorePage(emptyList(), LoreArticleFormat.RAW_HTML) to TOC_TITLE) + pathDirs.indices.map { i ->
-                       val prefixPath = pathDirs.take(i)
-                       Root.LorePage(prefixPath, LoreArticleFormat.RAW_HTML) to (StoragePath.articleDir / prefixPath).toFriendlyPageTitle()
-               }
+       else pagePath.indices.map { i ->
+               val prefixPath = pagePath.take(i)
+               Root.LorePage(prefixPath, LoreArticleFormat.RAW_HTML) to (StoragePath.articleDir / prefixPath).toFriendlyPageTitle()
        }
        
        val isValid = FileStorage.instance.getType(pageFile) != null && pageFile.isViewable