Add custom HTML shell template to Web export

This commit is contained in:
Wojtek Figat
2026-03-16 22:09:21 +01:00
parent 0f5c5dcf3e
commit e10d784e83
6 changed files with 152 additions and 4 deletions

View File

@@ -205,7 +205,15 @@ bool WebPlatformTools::OnPostProcess(CookingData& data)
FileSystem::CopyFile(dstIcon, platformDataPath / TEXT("favicon.ico"));
}
// TODO: customizable HTML templates
// Copy custom HTMl template
auto customHtml = platformSettings->CustomHtml.TrimTrailing();
if (customHtml.HasChars())
{
FileSystem::CopyFile(data.OriginalOutputPath / TEXT("FlaxGame.html"), customHtml);
}
// Rename game website main HTML file to match the most common name used by web servers (index.html)
FileSystem::MoveFile(data.OriginalOutputPath / TEXT("index.html"), data.OriginalOutputPath / TEXT("FlaxGame.html"), true);
// Insert packaged file system with game data
{
@@ -254,8 +262,6 @@ bool WebPlatformTools::OnPostProcess(CookingData& data)
return false;
GameCooker::PackageFiles();
// TODO: minify/compress output JS files (in Release builds)
LOG(Info, "Output website size: {0} MB", FileSystem::GetDirectorySize(data.OriginalOutputPath) / 1024 / 1024);
return false;