refactor: amend c2deccafae

Define new Area for blog
This commit is contained in:
Oliver Booth 2023-08-11 14:26:21 +01:00
parent 0ecef1a547
commit 2d4d6d3823
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61
5 changed files with 14 additions and 10 deletions

View File

@ -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;

View File

@ -8,6 +8,7 @@ namespace OliverBooth.Areas.Blog.Pages;
/// <summary>
/// Represents the page model for the <c>Article</c> page.
/// </summary>
[Area("blog")]
public class Article : PageModel
{
private readonly BlogService _blogService;

View File

@ -5,6 +5,7 @@ using OliverBooth.Services;
namespace OliverBooth.Areas.Blog.Pages;
[Area("blog")]
public class Index : PageModel
{
private readonly BlogService _blogService;

View File

@ -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;
/// <summary>
/// Represents the page model for the <c>RawArticle</c> page.
/// </summary>
[Area("blog")]
public class RawArticle : PageModel
{
private readonly BlogService _blogService;

View File

@ -36,22 +36,22 @@
<nav>
<ul class="site-nav">
<li>
<a asp-page="/index">About</a>
<a asp-area="" asp-page="/index">About</a>
</li>
<li>
<a asp-area="Blog" asp-page="/index">Blog</a>
<a asp-area="blog" asp-page="/index">Blog</a>
</li>
<li>
<a asp-page="/tutorials/index">Tutorials</a>
<a asp-area="" asp-page="/tutorials/index">Tutorials</a>
</li>
<li>
<a asp-page="/projects/index">Projects</a>
<a asp-area="" asp-page="/projects/index">Projects</a>
</li>
<li>
<a asp-page="/contact/index">Contact</a>
<a asp-area="" asp-page="/contact/index">Contact</a>
</li>
<li>
<a asp-page="/donate">Donate</a>
<a asp-area="" asp-page="/donate">Donate</a>
</li>
</ul>
</nav>
@ -68,7 +68,7 @@
<div class="container text-center">
&copy; @DateTime.UtcNow.Year
&bullet;
<a asp-page="/privacy/index">Privacy</a>
<a asp-area="" asp-page="/privacy/index">Privacy</a>
&bullet;
<a href="https://mastodon.olivr.me/@@oliver" rel="me">Mastodon</a>
&bullet;