PebbleTemplates / pebble

Java Template Engine
https://pebbletemplates.io
BSD 3-Clause "New" or "Revised" License
1.1k stars 168 forks source link

How to set custom template path loader to speed up development like Freemaker #645

Closed KurangKering closed 1 year ago

KurangKering commented 1 year ago

This java template engine is simply amazing. but how do I change the template path loader so I don't have to re-build every time something changes to the html file?

for example using freemaker i can change it like below.

spring.freemarker.template-loader-path=file:src/main/resources/templates/

thank you

KurangKering commented 1 year ago

application.properties

pebble.prefix=src/main/resources/templates pebble.suffix=.html pebble.cache=false

Bean

@Bean fun pebbleLoader(): FileLoader { val fileLoader = FileLoader() fileLoader.prefix = "src/main/resources/templates" fileLoader.suffix = ".html" return fileLoader }