From 2d4d6d3823ff6094c8f26a1e6ca5fe76b7aa5640 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Fri, 11 Aug 2023 14:26:21 +0100 Subject: [PATCH] refactor: amend c2deccafaeca3387e7fa9ec5c6bfa6202bdbb502 Define new Area for blog --- .../Api}/Controllers/BlogApiController.cs | 5 +++-- OliverBooth/Areas/Blog/Pages/Article.cshtml.cs | 1 + OliverBooth/Areas/Blog/Pages/Index.cshtml.cs | 1 + OliverBooth/Areas/Blog/Pages/RawArticle.cshtml.cs | 3 ++- OliverBooth/Pages/Shared/_Layout.cshtml | 14 +++++++------- 5 files changed, 14 insertions(+), 10 deletions(-) rename OliverBooth/{ => Areas/Api}/Controllers/BlogApiController.cs (96%) diff --git a/OliverBooth/Controllers/BlogApiController.cs b/OliverBooth/Areas/Api/Controllers/BlogApiController.cs similarity index 96% rename from OliverBooth/Controllers/BlogApiController.cs rename to OliverBooth/Areas/Api/Controllers/BlogApiController.cs index f9f82f6..8a4bf82 100644 --- a/OliverBooth/Controllers/BlogApiController.cs +++ b/OliverBooth/Areas/Api/Controllers/BlogApiController.cs @@ -3,10 +3,11 @@ using Microsoft.AspNetCore.Mvc; using OliverBooth.Data.Blog; using OliverBooth.Services; -namespace OliverBooth.Controllers; +namespace OliverBooth.Areas.Api.Controllers; [Controller] -[Route("/api/blog")] +[Area("api")] +[Route("blog")] public sealed class BlogApiController : ControllerBase { private readonly BlogService _blogService; diff --git a/OliverBooth/Areas/Blog/Pages/Article.cshtml.cs b/OliverBooth/Areas/Blog/Pages/Article.cshtml.cs index 94509d6..563959b 100644 --- a/OliverBooth/Areas/Blog/Pages/Article.cshtml.cs +++ b/OliverBooth/Areas/Blog/Pages/Article.cshtml.cs @@ -8,6 +8,7 @@ namespace OliverBooth.Areas.Blog.Pages; /// /// Represents the page model for the Article page. /// +[Area("blog")] public class Article : PageModel { private readonly BlogService _blogService; diff --git a/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs b/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs index fde635e..45f8f06 100644 --- a/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs +++ b/OliverBooth/Areas/Blog/Pages/Index.cshtml.cs @@ -5,6 +5,7 @@ using OliverBooth.Services; namespace OliverBooth.Areas.Blog.Pages; +[Area("blog")] public class Index : PageModel { private readonly BlogService _blogService; diff --git a/OliverBooth/Areas/Blog/Pages/RawArticle.cshtml.cs b/OliverBooth/Areas/Blog/Pages/RawArticle.cshtml.cs index d74e0b3..9b78797 100644 --- a/OliverBooth/Areas/Blog/Pages/RawArticle.cshtml.cs +++ b/OliverBooth/Areas/Blog/Pages/RawArticle.cshtml.cs @@ -1,4 +1,4 @@ -using Cysharp.Text; +using Cysharp.Text; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using OliverBooth.Data.Blog; @@ -9,6 +9,7 @@ namespace OliverBooth.Areas.Blog.Pages; /// /// Represents the page model for the RawArticle page. /// +[Area("blog")] public class RawArticle : PageModel { private readonly BlogService _blogService; diff --git a/OliverBooth/Pages/Shared/_Layout.cshtml b/OliverBooth/Pages/Shared/_Layout.cshtml index efbebd9..7feedb3 100644 --- a/OliverBooth/Pages/Shared/_Layout.cshtml +++ b/OliverBooth/Pages/Shared/_Layout.cshtml @@ -36,22 +36,22 @@ @@ -68,7 +68,7 @@
© @DateTime.UtcNow.Year • - Privacy + PrivacyMastodon