diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ce9ec3a5..8e7d442f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -92,8 +92,8 @@ jobs: echo -n "$jsFile" > service-worker-assets.js # copy index.html to 404.html to serve the same file when a file is not found - #- name: copy index.html to 404.html - # run: cp release/wwwroot/index.html release/wwwroot/404.html + - name: copy index.html to 404.html + run: cp release/wwwroot/index.html release/wwwroot/404.html # add .nojekyll file to tell GitHub pages to not treat this as a Jekyll project. (Allow files and folders starting with an underscore) - name: Add .nojekyll file diff --git a/src/Cropper.Blazor/Client/Program.cs b/src/Cropper.Blazor/Client/Program.cs index f41577df..5fbc41ed 100644 --- a/src/Cropper.Blazor/Client/Program.cs +++ b/src/Cropper.Blazor/Client/Program.cs @@ -1,8 +1,12 @@ +using Cropper.Blazor.Client; using Cropper.Blazor.Client.Extensions; using Cropper.Blazor.Extensions; +using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; var builder = WebAssemblyHostBuilder.CreateDefault(args); +builder.RootComponents.Add("#app"); +builder.RootComponents.Add("head::after"); builder.Services .AddScoped(sp => new HttpClient diff --git a/src/Cropper.Blazor/Server/Pages/_Host.cshtml b/src/Cropper.Blazor/Client/wwwroot/index.html similarity index 93% rename from src/Cropper.Blazor/Server/Pages/_Host.cshtml rename to src/Cropper.Blazor/Client/wwwroot/index.html index 683e18c4..dc8126cb 100644 --- a/src/Cropper.Blazor/Server/Pages/_Host.cshtml +++ b/src/Cropper.Blazor/Client/wwwroot/index.html @@ -1,9 +1,4 @@ -@page -@using Cropper.Blazor.Client; -@using Cropper.Blazor.Client.Shared; -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers - - + @@ -12,20 +7,20 @@ - - - - - + + + + + - - + + - - - - - + + + + + Cropper Blazor component for cropping images. @@ -44,8 +39,6 @@ - -
diff --git a/src/Cropper.Blazor/Server/Pages/_Host.cshtml.cs b/src/Cropper.Blazor/Server/Pages/_Host.cshtml.cs deleted file mode 100644 index e7e9cf83..00000000 --- a/src/Cropper.Blazor/Server/Pages/_Host.cshtml.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Microsoft.AspNetCore.Mvc.RazorPages; - -namespace Cropper.Blazor.Server.Pages -{ - public class _HostModel : PageModel - { - public void OnGet() - { - } - } -} diff --git a/src/Cropper.Blazor/Server/Program.cs b/src/Cropper.Blazor/Server/Program.cs index e7590f6f..a80508e3 100644 --- a/src/Cropper.Blazor/Server/Program.cs +++ b/src/Cropper.Blazor/Server/Program.cs @@ -1,12 +1,9 @@ -using Cropper.Blazor.Client.Extensions; - var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllersWithViews(); builder.Services.AddRazorPages(); -builder.Services.TryAddDocsViewServices(); var app = builder.Build(); @@ -31,6 +28,6 @@ app.MapRazorPages(); app.MapControllers(); -app.MapFallbackToPage("/_Host"); +app.MapFallbackToFile("index.html"); app.Run();