style: format url as yyyy/MM/dd
This commit is contained in:
parent
becd70c865
commit
1a726b4962
@ -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;
|
||||||
@ -41,9 +41,9 @@ public class Index : PageModel
|
|||||||
var route = new
|
var route = new
|
||||||
{
|
{
|
||||||
area = "blog",
|
area = "blog",
|
||||||
year = post.Published.Year,
|
year = post.Published.ToString("yyyy"),
|
||||||
month = post.Published.Month,
|
month = post.Published.ToString("MM"),
|
||||||
day = post.Published.Day,
|
day = post.Published.ToString("dd"),
|
||||||
slug = post.Slug
|
slug = post.Slug
|
||||||
};
|
};
|
||||||
return Redirect(Url.Page("/Article", route)!);
|
return Redirect(Url.Page("/Article", route)!);
|
||||||
|
Loading…
Reference in New Issue
Block a user