fix: use area "blog" for page link
This commit is contained in:
parent
1bdd2a04f0
commit
becd70c865
|
@ -49,9 +49,10 @@ public sealed class BlogApiController : ControllerBase
|
||||||
humanizedTimestamp = post.Updated?.Humanize() ?? post.Published.Humanize(),
|
humanizedTimestamp = post.Updated?.Humanize() ?? post.Published.Humanize(),
|
||||||
excerpt = _blogService.GetExcerpt(post, out bool trimmed),
|
excerpt = _blogService.GetExcerpt(post, out bool trimmed),
|
||||||
trimmed,
|
trimmed,
|
||||||
url = Url.Page("/Blog/Article",
|
url = Url.Page("/Article",
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
|
area = "blog",
|
||||||
year = post.Published.ToString("yyyy"),
|
year = post.Published.ToString("yyyy"),
|
||||||
month = post.Published.ToString("MM"),
|
month = post.Published.ToString("MM"),
|
||||||
day = post.Published.ToString("dd"),
|
day = post.Published.ToString("dd"),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using OliverBooth.Data.Blog;
|
using OliverBooth.Data.Blog;
|
||||||
using OliverBooth.Services;
|
using OliverBooth.Services;
|
||||||
|
@ -40,11 +40,12 @@ public class Index : PageModel
|
||||||
{
|
{
|
||||||
var route = new
|
var route = new
|
||||||
{
|
{
|
||||||
|
area = "blog",
|
||||||
year = post.Published.Year,
|
year = post.Published.Year,
|
||||||
month = post.Published.Month,
|
month = post.Published.Month,
|
||||||
day = post.Published.Day,
|
day = post.Published.Day,
|
||||||
slug = post.Slug
|
slug = post.Slug
|
||||||
};
|
};
|
||||||
return Redirect(Url.Page("/Blog/Article", route)!);
|
return Redirect(Url.Page("/Article", route)!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue