@page "/blog/{year:int}/{month:int}/{day:int}/{slug}" @using Humanizer @using OliverBooth.Common.Data.Blog @using OliverBooth.Common.Services @inject IBlogPostService BlogPostService @model Article @if (Model.ShowPasswordPrompt) {
return; } @if (Model.Post is not { } post) { return; } @{ ViewData["Post"] = post; ViewData["Title"] = post.Title; IAuthor author = post.Author; DateTimeOffset published = post.Published; } @switch (post.Visibility) { case BlogPostVisibility.Private: break; case BlogPostVisibility.Unlisted: break; }

@post.Title

@author.DisplayName @author.DisplayName • Published @published.Humanize() @if (post.Updated is { } updated) { Updated @updated.Humanize() } @if (post.EnableComments) { 0 Comments }

@foreach (string tag in post.Tags) { @tag }

@Html.Raw(BlogPostService.RenderPost(post))

@if (BlogPostService.GetPreviousPost(post) is { } previousPost) { Previous Post

@previousPost.Title

}
@if (BlogPostService.GetNextPost(post) is { } nextPost) { Next Post

@nextPost.Title

}

@if (post.EnableComments) {
} else {

Comments are not enabled for this post.

}