diff --git a/TaxBaik.Web/Controllers/BlogController.cs b/TaxBaik.Web/Controllers/BlogController.cs index d88c01a..47f6ad1 100644 --- a/TaxBaik.Web/Controllers/BlogController.cs +++ b/TaxBaik.Web/Controllers/BlogController.cs @@ -32,10 +32,6 @@ public class BlogController : ControllerBase return Ok(post); } - [HttpGet("~/blog/{slug}")] - public IActionResult RedirectToBlogPage(string slug) - => RedirectPermanent($"/taxbaik/blog/{slug}"); - [HttpGet("admin/all")] [Authorize] public async Task GetAll() diff --git a/TaxBaik.Web/Program.cs b/TaxBaik.Web/Program.cs index 2ff39cc..b0bf4af 100644 --- a/TaxBaik.Web/Program.cs +++ b/TaxBaik.Web/Program.cs @@ -142,60 +142,6 @@ if (!app.Environment.IsDevelopment()) app.MapControllers(); app.MapHealthChecks("/healthz"); app.MapRazorPages(); -app.MapGet("/blog/{slug}", async (string slug, TaxBaik.Application.Services.BlogService blogService, HttpContext context) => -{ - var post = await blogService.GetBySlugAsync(slug, context.RequestAborted); - if (post == null) - return Results.NotFound(); - - var baseUrl = $"{context.Request.Scheme}://{context.Request.Host}{context.Request.PathBase}"; - var canonical = $"{baseUrl}/blog/{post.Slug}"; - var html = $""" - - - - - - {System.Net.WebUtility.HtmlEncode(post.SeoTitle ?? post.Title)} - - - - -
-

{System.Net.WebUtility.HtmlEncode(post.Title)}

-
- - -"""; - return Results.Content(html, "text/html; charset=utf-8"); -}); -app.MapGet("/taxbaik/blog/{slug}", async (string slug, TaxBaik.Application.Services.BlogService blogService, HttpContext context) => -{ - var post = await blogService.GetBySlugAsync(slug, context.RequestAborted); - if (post == null) - return Results.NotFound(); - - var baseUrl = $"{context.Request.Scheme}://{context.Request.Host}{context.Request.PathBase}"; - var canonical = $"{baseUrl}/blog/{post.Slug}"; - var html = $""" - - - - - - {System.Net.WebUtility.HtmlEncode(post.SeoTitle ?? post.Title)} - - - - -
-

{System.Net.WebUtility.HtmlEncode(post.Title)}

-
- - -"""; - return Results.Content(html, "text/html; charset=utf-8"); -}); app.MapRazorComponents().AddInteractiveServerRenderMode(); app.Run();