Skip to content

Commit

Permalink
updated index html file
Browse files Browse the repository at this point in the history
  • Loading branch information
suxrobGM committed Aug 4, 2024
1 parent 664f1cc commit 2d5f51e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/FormBuilder.DesignerApp/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webassembly.js"></script>

<!-- Explicitly load the InitFormBuilder.js script for GH Pages deployment -->
<script type="module" src="_content/FormBuilder/Components/InitFormBuilder.js"></script>
</body>

</html>
5 changes: 1 addition & 4 deletions src/FormBuilder/Components/InitFormBuilder.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ public partial class InitFormBuilder : ComponentBase

protected override async Task OnInitializedAsync()
{
// Use relative path for GitHub Pages
var basePath = Environment.GetEnvironmentVariable("GH_PAGES") == "true" ? "./" : "/";

await JSHost.ImportAsync(nameof(InitFormBuilder),
$"{basePath}_content/FormBuilder/Components/InitFormBuilder.js");
"/_content/FormBuilder/Components/InitFormBuilder.js");

LoadStaticFiles();
}
Expand Down

0 comments on commit 2d5f51e

Please sign in to comment.