Skip to content

Commit

Permalink
Merge pull request quarkusio#43591 from mkouba/qute-engine-producer-l…
Browse files Browse the repository at this point in the history
…ocate-fix

Qute: fix reload of templates backed by build item
  • Loading branch information
ia3andy authored Sep 30, 2024
2 parents 9bba606 + 35ecc2f commit cd64f5b
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 cd64f5b

Please sign in to comment.