Tag: freemarker

用Ktor Kotlin处理FreeMaker模板

我对Kotlin (和Java)以及Ktor和FreeMaker ,试图将所有这些应用程序组合起来,但看起来我正在做一些与FreeMaker模板操作有关的错误。 我的应用程序结构是: template.ftl : <#macro mainLayout title="Welcome"> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>${title} | Kweet</title> </head> <body> HI </body> </html> </#macro> index.ftl : <#import "template.ftl" as layout /> imported title: ${title} <@layout.mainLayout title="Welcome"> <div class="posts"> <h3 class="content-subhead">Top 10</h3> </div> </@layout.mainLayout> BlogApp.kt : 包博客 import kotlinx.html.* import org.jetbrains.ktor.freemarker.* import org.jetbrains.ktor.host.* // […]