fix: use area "blog" for page link

This commit is contained in:
Oliver Booth 2023-08-11 15:42:48 +01:00
parent 1bdd2a04f0
commit becd70c865
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61
2 changed files with 5 additions and 3 deletions

View File

@ -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"),

View File

@ -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)!);
}
}