Skip to content

Commit

Permalink
Qute: fix reload of templates backed by build item
Browse files Browse the repository at this point in the history
  • Loading branch information
mkouba committed Sep 30, 2024
1 parent 96d8967 commit 35ecc2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public void testTemplate() {
assertEquals("Hello M!", engine.getTemplate("foo/hello.txt").data("name", "M").render());
assertEquals("Hello M!", engine.getTemplate("foo/hello").data("name", "M").render());
assertEquals("And... Hello M!", engine.getTemplate("include").data("name", "M").render());

// Test that reload works for additional content-based paths
engine.clearTemplates();
assertEquals("Hello M!", engine.getTemplate("foo/hello").data("name", "M").render());
assertEquals("Hello M!", engine.getTemplate("foo/hello.txt").data("name", "M").render());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ private Optional<TemplateLocation> locate(String path) {
// Then try the template contents
LOGGER.debugf("Locate template contents for %s", path);
String content = templateContents.get(path);
if (path == null) {
if (content == null) {
// Try path with suffixes
for (String suffix : suffixes) {
String pathWithSuffix = path + "." + suffix;
Expand Down

0 comments on commit 35ecc2f

Please sign in to comment.