From 59b1da9244a8e0212bdb320c26e10d10543c5b6e Mon Sep 17 00:00:00 2001 From: Lanius Trolling Date: Sun, 18 Jun 2023 09:45:53 -0400 Subject: [PATCH] WIP factbook links are now not rendered at all, instead of being rendered invisible --- .../info/mechyrdia/lore/article_listing.kt | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/info/mechyrdia/lore/article_listing.kt b/src/main/kotlin/info/mechyrdia/lore/article_listing.kt index 81c1029..8f98b6c 100644 --- a/src/main/kotlin/info/mechyrdia/lore/article_listing.kt +++ b/src/main/kotlin/info/mechyrdia/lore/article_listing.kt @@ -1,7 +1,10 @@ package info.mechyrdia.lore import info.mechyrdia.Configuration -import kotlinx.html.* +import kotlinx.html.UL +import kotlinx.html.a +import kotlinx.html.li +import kotlinx.html.ul import java.io.File data class ArticleNode(val name: String, val subNodes: List) @@ -18,16 +21,14 @@ fun File.toArticleNode(): ArticleNode = ArticleNode( fun List.renderInto(list: UL, base: String? = null) { val prefix = base?.let { "$it/" } ?: "" forEach { node -> - list.li { - if (!Configuration.CurrentConfiguration.isDevMode && (node.name.endsWith(".wip") || node.name.endsWith(".old"))) - style = "display:none" - - a(href = "/lore/$prefix${node.name}") { +node.name } - if (node.subNodes.isNotEmpty()) - ul { - node.subNodes.renderInto(this, "$prefix${node.name}") - } - } + if (Configuration.CurrentConfiguration.isDevMode || !(node.name.endsWith(".wip") || node.name.endsWith(".old"))) + list.li { + a(href = "/lore/$prefix${node.name}") { +node.name } + if (node.subNodes.isNotEmpty()) + ul { + node.subNodes.renderInto(this, "$prefix${node.name}") + } + } } } -- 2.25.1