private const val INTRO_COMMENTS_PATH = "/"
suspend fun ApplicationCall.loreIntroPage(): HTML.() -> Unit {
- val totalsData = processGuestbook()
-
- val (canCommentAs, comments) = coroutineScope {
- val canCommentAs = async { currentNation() }
- val comments = async {
- CommentRenderData(Comment.getCommentsIn(INTRO_COMMENTS_PATH).toList(), nationCache)
- }
-
- canCommentAs.await() to comments.await()
- }
-
val htmlFile = File(Configuration.CurrentConfiguration.articleDir).parentFile.combineSafe("intro.html")
val fileHtml = htmlFile.readText()
a { id = "page-top" }
unsafe { raw(fileHtml) }
}
-
- finalSection(INTRO_COMMENTS_PATH, canCommentAs, comments, totalsData)
}
}