AppGlobals

A list of globals for this app.

You can register them in your build script, for example:

kobweb {
app {
globals.putAll(mapOf(
"author" to "bitspittle",
"version" to "v1234.5678"
))
)
}

And then fetch them in your own site:

AppGlobals.getValue("author") // "bitspittle"

Consider creating a type-safe extensions for your constants:

val AppGlobals.author get() = AppGlobals.getValue("author")
val AppGlobals.version get() = AppGlobals.getValue("version")

or, if you prefer, a wrapper object:

object SiteGlobals {
val author = AppGlobals.getValue("author")
val version = AppGlobals.getValue("version")
}

Properties

Link copied to clipboard

A property which indicates if we are currently running this site as part of a Kobweb export.

Link copied to clipboard

Functions

Link copied to clipboard
operator fun get(key: String): String?
Link copied to clipboard
Link copied to clipboard
fun initialize(values: Map<String, String>)

Initialize the backing data values for this class.