@page "/tutorial/{**slug}" @using Humanizer @using Microsoft.AspNetCore.Mvc.TagHelpers @using OliverBooth.Data @using OliverBooth.Data.Web @using OliverBooth.Services @inject ITutorialService TutorialService @model Article @if (Model.CurrentArticle is not { } article) { return; } @{ ViewData["Post"] = article; ViewData["Title"] = article.Title; DateTimeOffset published = article.Published; }

@article.Title

Published @published.Humanize() @if (article.Updated is { } updated) { Updated @updated.Humanize() }


@Html.Raw(TutorialService.RenderArticle(article))
@if (article.HasOtherParts) {
@if (article.PreviousPart is { } previousPartId && TutorialService.TryGetArticle(previousPartId, out ITutorialArticle? previousPart) && previousPart.Visibility == Visibility.Published) { Previous Part

@previousPart.Title

}
@if (article.NextPart is { } nextPartId && TutorialService.TryGetArticle(nextPartId, out ITutorialArticle? nextPart) && nextPart.Visibility == Visibility.Published) { Next Part

@nextPart.Title

}
}
@if (article.EnableComments) {
@section Scripts { } } else {

Comments are not enabled for this post.

}