@page "/tutorial/{**slug}" @using Humanizer @using Markdig @using Microsoft.AspNetCore.Mvc.TagHelpers @using OliverBooth.Data @using OliverBooth.Data.Blog @using OliverBooth.Data.Web @using OliverBooth.Services @inject ITutorialService TutorialService @inject MarkdownPipeline MarkdownPipeline @model Article @if (Model.CurrentArticle is not { } article) { return; } @{ ViewData["Post"] = article; ViewData["Title"] = article.Title; DateTimeOffset published = article.Published; }
Published @published.Humanize() @if (article.Updated is { } updated) { • Updated @updated.Humanize() }
@("legacy comment".ToQuantity(commentCount))
Legacy comments are comments that were posted using a commenting system that I no longer use. This exists for posterity.
while (commentStack.Count > 0) { ILegacyComment comment = commentStack.Pop(); foreach (ILegacyComment reply in TutorialService.GetLegacyReplies(comment).OrderByDescending(c => c.CreatedAt)) { if (nestLevelMap.TryGetValue(comment, out int currentLevel)) { nestLevelMap[reply] = currentLevel + 1; } else { nestLevelMap[reply] = 1; } commentStack.Push(reply); } int padding = 0; if (nestLevelMap.TryGetValue(comment, out int nestLevel)) { padding = 50 * nestLevel; }Comments are not enabled for this post.
}