templates_rocker
Rocker template engine adapter for Hexagon.
For usage instructions, refer to the /templates/.
Install the Dependency
=== "build.gradle"
```groovy
repositories {
mavenCentral()
}
implementation("com.hexagonkt:templates_rocker:$hexagonVersion")
```
Content copied to clipboard
=== "pom.xml"
```xml
com.hexagonkt
templates_rocker
$hexagonVersion
```
Content copied to clipboard
Use the Adapter
In order to use this adapter you need to set up a build plugin to compile the templates. To do so in Gradle, add the following lines to build.gradle.kts
:
rocker {
configurations {
create("main") {
templateDir.set(file("src/main/resources"))
optimize.set(true)
}
}
}
Content copied to clipboard
On top of that, you must also declare the template parameters this way: @args(java.util.Map<String, Object> context)
and use the data from the map.