Rename templates to get syntax highlighting
This commit is contained in:
parent
fda355a690
commit
cdfe1d14ef
@ -4,7 +4,13 @@ import com.soywiz.korte.TemplateProvider
|
|||||||
|
|
||||||
class ResourceTemplateProvider : TemplateProvider {
|
class ResourceTemplateProvider : TemplateProvider {
|
||||||
override suspend fun get(template: String): String? {
|
override suspend fun get(template: String): String? {
|
||||||
val resource = "/templates/$template"
|
|
||||||
|
val tmp = when {
|
||||||
|
template.endsWith(".html") -> template.substringBefore(".html")
|
||||||
|
else -> template
|
||||||
|
}
|
||||||
|
|
||||||
|
val resource = "/templates/${tmp}.twig"
|
||||||
return this.javaClass.getResource(resource)?.readText()
|
return this.javaClass.getResource(resource)?.readText()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user