Skip to content

Commit

Permalink
Fix index.html for compat before 3.9 and dynamic index
Browse files Browse the repository at this point in the history
(cherry picked from commit 0c265bc)
  • Loading branch information
ia3andy authored and gsmet committed Jun 18, 2024
1 parent f8a7112 commit 60b7380
Show file tree
Hide file tree
Showing 2 changed files with 300 additions and 1 deletion.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
import io.quarkus.devtools.codestarts.CodestartStructureException;
import io.quarkus.devtools.codestarts.core.reader.TargetFile;

/**
*
* @deprecated this was a quick-n-dirty way to allow extensions to provide content to the index.html,
* we don't need it anymore with the dynamic index.html. If we need something similar in the future let's find a
* more elegant way.
*/
@Deprecated
final class ContentMergeCodestartFileStrategyHandler implements CodestartFileStrategyHandler {

static final String NAME = "content-merge";
Expand Down Expand Up @@ -40,6 +47,10 @@ public void process(Path targetDirectory, String relativePath, List<TargetFile>
return;
}
createDirectories(targetPath);
writeFile(targetPath, template.get().getContent().replace("{merged-content}", mergedContent.toString()));
final String content = template.get().getContent();
if (content.isBlank()) {
return;
}
writeFile(targetPath, content.replace("{merged-content}", mergedContent.toString()));
}
}

0 comments on commit 60b7380

Please sign in to comment.