@page "/tutorial/{**slug}" @using Humanizer @using Markdig @using Microsoft.AspNetCore.Mvc.TagHelpers @using OliverBooth.Common.Data @using OliverBooth.Common.Data.Blog @using OliverBooth.Common.Data.Web @using OliverBooth.Common.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.
}