From 437404d8e848e3eaf09ba9002fbf96e5ecbf6132 Mon Sep 17 00:00:00 2001 From: Lanius Trolling Date: Tue, 23 Apr 2024 15:13:44 -0400 Subject: [PATCH] Okay, NOW it should work --- src/jvmMain/kotlin/info/mechyrdia/lore/ViewsLore.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/jvmMain/kotlin/info/mechyrdia/lore/ViewsLore.kt b/src/jvmMain/kotlin/info/mechyrdia/lore/ViewsLore.kt index 9bed60d..699bc11 100644 --- a/src/jvmMain/kotlin/info/mechyrdia/lore/ViewsLore.kt +++ b/src/jvmMain/kotlin/info/mechyrdia/lore/ViewsLore.kt @@ -67,12 +67,9 @@ suspend fun ApplicationCall.loreRawArticlePage(pagePath: List): 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 -- 2.25.1