From 5d5cc4bec936b6d4d6dfe9d0df6272fdeb33424a Mon Sep 17 00:00:00 2001 From: Demis Bellot Date: Fri, 1 Mar 2024 11:44:49 +0800 Subject: [PATCH] Remove ServiceStack.Mvc --- MyApp/Configure.Ssg.cs | 24 ------------------------ MyApp/MyApp.csproj | 2 -- 2 files changed, 26 deletions(-) diff --git a/MyApp/Configure.Ssg.cs b/MyApp/Configure.Ssg.cs index e16c232..7254758 100644 --- a/MyApp/Configure.Ssg.cs +++ b/MyApp/Configure.Ssg.cs @@ -44,30 +44,6 @@ public void Configure(IWebHostBuilder builder) => builder pages.LoadFrom("_pages"); videos.LoadFrom("_videos"); blogPosts.LoadFrom("_posts"); - }, - afterAppHostInit: appHost => - { - // prerender with: `$ npm run prerender` - AppTasks.Register("prerender", args => - { - appHost.Resolve().RenderToAsync( - metaDir: appHost.ContentRootDirectory.RealPath.CombineWith("wwwroot/meta"), - baseUrl: HtmlHelpers.ToAbsoluteContentUrl("")).GetAwaiter().GetResult(); - - var distDir = appHost.ContentRootDirectory.RealPath.CombineWith("dist"); - if (Directory.Exists(distDir)) - FileSystemVirtualFiles.DeleteDirectory(distDir); - FileSystemVirtualFiles.CopyAll( - new DirectoryInfo(appHost.ContentRootDirectory.RealPath.CombineWith("wwwroot")), - new DirectoryInfo(distDir)); - - // Render .html redirect files - RazorSsg.PrerenderRedirectsAsync(appHost.ContentRootDirectory.GetFile("redirects.json"), distDir) - .GetAwaiter().GetResult(); - - var razorFiles = appHost.VirtualFiles.GetAllMatchingFiles("*.cshtml"); - RazorSsg.PrerenderAsync(appHost, razorFiles, distDir).GetAwaiter().GetResult(); - }); }); } diff --git a/MyApp/MyApp.csproj b/MyApp/MyApp.csproj index 13719ab..f895da1 100644 --- a/MyApp/MyApp.csproj +++ b/MyApp/MyApp.csproj @@ -12,7 +12,6 @@ - @@ -32,7 +31,6 @@ -