com.lightningkite.lightningserver.HtmlDefaults.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of server-core Show documentation
Show all versions of server-core Show documentation
A set of tools to fill in/replace what Ktor is lacking in.
The newest version!
package com.lightningkite.lightningserver
import com.lightningkite.lightningserver.settings.generalSettings
/**
* HtmlDefaults Is a place to hold html templates. You can set certain styling and headers here as a template, then call it with content
* all throughout the server.
*/
object HtmlDefaults {
/**
* The logo of the company as an HTML element string.
*/
var logo: String? by SetOnce { null }
/**
* The primary color of the company as a CSS color.
*/
var primaryColor: String by SetOnce { "red" }
/**
* Default HTML wrapper for an HTML page in the system
*/
var basePage: (content: String) -> String by SetOnce {
{ content ->
"""
${generalSettings().projectName}
$content
""".trimIndent()
}
}
/**
* Default HTML wrapper for an email from the system
*/
var baseEmail: (content: String) -> String by SetOnce {
{ content ->
"""
$content
""".trimIndent()
}
}
}