.sortedBy { it.subNodes.isEmpty() }
)
+private val String.isViewable: Boolean
+ get() = Configuration.CurrentConfiguration.isDevMode || !(endsWith(".wip") || endsWith(".old"))
+
+val ArticleNode.isViewable: Boolean
+ get() = name.isViewable
+
+val File.isViewable: Boolean
+ get() = name.isViewable
+
fun List<ArticleNode>.renderInto(list: UL, base: String? = null) {
val prefix by lazy(LazyThreadSafetyMode.NONE) { base?.let { "$it/" } ?: "" }
for (node in this) {
- if (Configuration.CurrentConfiguration.isDevMode || !(node.name.endsWith(".wip") || node.name.endsWith(".old")))
+ if (node.isViewable)
list.li {
a(href = "/lore/$prefix${node.name}") { +node.name }
if (node.subNodes.isNotEmpty())
canCommentAs.await() to comments.await()
}
- val isValid = pageFile.exists() && (Configuration.CurrentConfiguration.isDevMode || !(pageFile.name.endsWith(".wip") || pageFile.name.endsWith(".old")))
+ val isValid = pageFile.exists() && pageFile.isViewable
if (isValid) {
if (pageFile.isDirectory) {