Skip to content

Commit

Permalink
Merge pull request quarkusio#41254 from ia3andy/fix-compat-index
Browse files Browse the repository at this point in the history
Fix index.html for compat before 3.9 and dynamic index
  • Loading branch information
ia3andy committed Jun 17, 2024
2 parents fd0eac6 + 0c265bc commit 50431f0
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 50431f0

Please sign in to comment.