Fix main page title
authorLanius Trolling <lanius@laniustrolling.dev>
Thu, 16 Jun 2022 20:52:46 +0000 (16:52 -0400)
committerLanius Trolling <lanius@laniustrolling.dev>
Thu, 16 Jun 2022 20:52:46 +0000 (16:52 -0400)
src/main/kotlin/info/mechyrdia/lore/views_lore.kt

index e0ad34427eb0c118b4d827d8161b0fb99c38351e..0a855a4fcb9ed0bd7b32618c0daaeab4d178a6fb 100644 (file)
@@ -15,9 +15,11 @@ fun ApplicationCall.loreArticlePage(): HTML.() -> Unit {
        if (pageFile.isDirectory) {
                val navbar = standardNavBar(pagePathParts.takeIf { it.isNotEmpty() })
                
-               return page("~/${pagePath}", navbar, null) {
+               val title = pagePath.takeIf { it.isNotEmpty() }?.let { "~/$it" } ?: "Mechyrdia Infobase"
+               
+               return page(title, navbar, null) {
                        section {
-                               h1 { +"~/${pagePath}" }
+                               h1 { +title }
                                ul {
                                        pageNode.subNodes.renderInto(this, pagePath.takeIf { it.isNotEmpty() })
                                }