refactor: move blog to new asp area
This commit is contained in:
parent
3c6a2209c2
commit
c2deccafae
@ -1,8 +1,8 @@
|
||||
@page "/blog/{year:int}/{month:int}/{day:int}/{slug}"
|
||||
@page "/blog/{year:int}/{month:int}/{day:int}/{slug}"
|
||||
@using Humanizer
|
||||
@using OliverBooth.Data.Blog
|
||||
@using OliverBooth.Services
|
||||
@model OliverBooth.Pages.Blog.Article
|
||||
@model OliverBooth.Areas.Blog.Pages.Article
|
||||
@inject BlogService BlogService
|
||||
|
||||
@if (Model.Post is not { } post)
|
@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using OliverBooth.Data.Blog;
|
||||
using OliverBooth.Services;
|
||||
|
||||
namespace OliverBooth.Pages.Blog;
|
||||
namespace OliverBooth.Areas.Blog.Pages;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the page model for the <c>Article</c> page.
|
@ -1,5 +1,5 @@
|
||||
@page
|
||||
@model OliverBooth.Pages.Blog.Index
|
||||
@model OliverBooth.Areas.Blog.Pages.Index
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Blog";
|
@ -1,9 +1,9 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using OliverBooth.Data.Blog;
|
||||
using OliverBooth.Services;
|
||||
|
||||
namespace OliverBooth.Pages.Blog;
|
||||
namespace OliverBooth.Areas.Blog.Pages;
|
||||
|
||||
public class Index : PageModel
|
||||
{
|
@ -1,2 +1,2 @@
|
||||
@page "/blog/{year:int}/{month:int}/{day:int}/{slug}/raw"
|
||||
@model OliverBooth.Pages.Blog.RawArticle
|
||||
@model OliverBooth.Areas.Blog.Pages.RawArticle
|
@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using OliverBooth.Data.Blog;
|
||||
using OliverBooth.Services;
|
||||
|
||||
namespace OliverBooth.Pages.Blog;
|
||||
namespace OliverBooth.Areas.Blog.Pages;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the page model for the <c>RawArticle</c> page.
|
@ -39,7 +39,7 @@
|
||||
<a asp-page="/index">About</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-page="/blog/index">Blog</a>
|
||||
<a asp-area="Blog" asp-page="/index">Blog</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-page="/tutorials/index">Tutorials</a>
|
||||
|
@ -80,6 +80,7 @@ app.UseRouting();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
app.MapControllerRoute("scoped", "{area:exists}/{controller=Home}/{action=Index}/{id?}");
|
||||
app.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
|
||||
app.MapRazorPages();
|
||||
app.MapRssFeed("/blog/feed");
|
||||
|
Loading…
Reference in New Issue
Block a user