diff --git a/OliverBooth/Areas/Api/Controllers/BlogApiController.cs b/OliverBooth/Areas/Api/Controllers/BlogApiController.cs index d16b396..14aed01 100644 --- a/OliverBooth/Areas/Api/Controllers/BlogApiController.cs +++ b/OliverBooth/Areas/Api/Controllers/BlogApiController.cs @@ -49,9 +49,10 @@ public sealed class BlogApiController : ControllerBase humanizedTimestamp = post.Updated?.Humanize() ?? post.Published.Humanize(), excerpt = _blogService.GetExcerpt(post, out bool trimmed), trimmed, - url = Url.Page("/Blog/Article", + url = Url.Page("/Article", new { + area = "blog", year = post.Published.ToString("yyyy"), month = post.Published.ToString("MM"), day = post.Published.ToString("dd"), diff --git a/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs b/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs index 45f8f06..05971d5 100644 --- a/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs +++ b/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using OliverBooth.Data.Blog; using OliverBooth.Services; @@ -40,11 +40,12 @@ public class Index : PageModel { var route = new { + area = "blog", year = post.Published.Year, month = post.Published.Month, day = post.Published.Day, slug = post.Slug }; - return Redirect(Url.Page("/Blog/Article", route)!); + return Redirect(Url.Page("/Article", route)!); } }