diff --git a/OliverBooth/Pages/Blog/Article.cshtml b/OliverBooth/Areas/Blog/Pages/Article.cshtml similarity index 96% rename from OliverBooth/Pages/Blog/Article.cshtml rename to OliverBooth/Areas/Blog/Pages/Article.cshtml index 8ad1dc7..7db7936 100644 --- a/OliverBooth/Pages/Blog/Article.cshtml +++ b/OliverBooth/Areas/Blog/Pages/Article.cshtml @@ -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) diff --git a/OliverBooth/Pages/Blog/Article.cshtml.cs b/OliverBooth/Areas/Blog/Pages/Article.cshtml.cs similarity index 97% rename from OliverBooth/Pages/Blog/Article.cshtml.cs rename to OliverBooth/Areas/Blog/Pages/Article.cshtml.cs index 16a84a5..94509d6 100644 --- a/OliverBooth/Pages/Blog/Article.cshtml.cs +++ b/OliverBooth/Areas/Blog/Pages/Article.cshtml.cs @@ -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; /// /// Represents the page model for the Article page. diff --git a/OliverBooth/Pages/Blog/Index.cshtml b/OliverBooth/Areas/Blog/Pages/Index.cshtml similarity index 96% rename from OliverBooth/Pages/Blog/Index.cshtml rename to OliverBooth/Areas/Blog/Pages/Index.cshtml index 6a51288..070a47d 100644 --- a/OliverBooth/Pages/Blog/Index.cshtml +++ b/OliverBooth/Areas/Blog/Pages/Index.cshtml @@ -1,5 +1,5 @@ @page -@model OliverBooth.Pages.Blog.Index +@model OliverBooth.Areas.Blog.Pages.Index @{ ViewData["Title"] = "Blog"; diff --git a/OliverBooth/Pages/Blog/Index.cshtml.cs b/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs similarity index 94% rename from OliverBooth/Pages/Blog/Index.cshtml.cs rename to OliverBooth/Areas/Blog/Pages/Index.cshtml.cs index 2db453c..4866c4e 100644 --- a/OliverBooth/Pages/Blog/Index.cshtml.cs +++ b/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs @@ -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 { diff --git a/OliverBooth/Pages/Blog/RawArticle.cshtml b/OliverBooth/Areas/Blog/Pages/RawArticle.cshtml similarity index 57% rename from OliverBooth/Pages/Blog/RawArticle.cshtml rename to OliverBooth/Areas/Blog/Pages/RawArticle.cshtml index 01625ef..cf3dc29 100644 --- a/OliverBooth/Pages/Blog/RawArticle.cshtml +++ b/OliverBooth/Areas/Blog/Pages/RawArticle.cshtml @@ -1,2 +1,2 @@ @page "/blog/{year:int}/{month:int}/{day:int}/{slug}/raw" -@model OliverBooth.Pages.Blog.RawArticle \ No newline at end of file +@model OliverBooth.Areas.Blog.Pages.RawArticle \ No newline at end of file diff --git a/OliverBooth/Pages/Blog/RawArticle.cshtml.cs b/OliverBooth/Areas/Blog/Pages/RawArticle.cshtml.cs similarity index 97% rename from OliverBooth/Pages/Blog/RawArticle.cshtml.cs rename to OliverBooth/Areas/Blog/Pages/RawArticle.cshtml.cs index 3f12fa5..d74e0b3 100644 --- a/OliverBooth/Pages/Blog/RawArticle.cshtml.cs +++ b/OliverBooth/Areas/Blog/Pages/RawArticle.cshtml.cs @@ -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; /// /// Represents the page model for the RawArticle page. diff --git a/OliverBooth/Pages/Shared/_Layout.cshtml b/OliverBooth/Pages/Shared/_Layout.cshtml index 5e6bb9d..efbebd9 100644 --- a/OliverBooth/Pages/Shared/_Layout.cshtml +++ b/OliverBooth/Pages/Shared/_Layout.cshtml @@ -39,7 +39,7 @@ About
  • - Blog + Blog
  • Tutorials diff --git a/OliverBooth/Program.cs b/OliverBooth/Program.cs index 2d0ce26..963b0f3 100644 --- a/OliverBooth/Program.cs +++ b/OliverBooth/Program.cs @@ -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");