@page "/blog/{year:int}/{month:int}/{day:int}/{slug}" @using Humanizer @using Markdig @using Microsoft.AspNetCore.Mvc.TagHelpers @using OliverBooth.Common.Data @using OliverBooth.Common.Data.Blog @using OliverBooth.Common.Services @inject IBlogPostService BlogPostService @inject MarkdownPipeline MarkdownPipeline @model Article @if (Model.ShowPasswordPrompt) {
@author.DisplayName • Published @published.Humanize() @if (post.Updated is { } updated) { • Updated @updated.Humanize() }
Comments are not enabled for this post.
} @{ int commentCount = BlogPostService.GetLegacyCommentCount(post); if (commentCount > 0) {@("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 BlogPostService.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; }