@page @using Humanizer @using OliverBooth.Data.Blog @using OliverBooth.Services @model OliverBooth.Pages.Blog.Index @inject BlogService BlogService @foreach (BlogPost post in BlogService.AllPosts) { Author? author = Model.GetAuthor(post); DateTimeOffset published = post.Published; var year = published.ToString("yyyy"); var month = published.ToString("MM"); var day = published.ToString("dd"); bool isLegacyPost = post.WordPressId is not null; string disqusDomain = isLegacyPost ? "https://blog.oliverbooth.dev" : "https://oliverbooth.dev/blog"; string disqusId = isLegacyPost ? $"{post.WordPressId} {disqusDomain}/?p={post.WordPressId}" : post.Id.ToString();

@post.Title

@author?.Name • @post.Published.Humanize() @if (post.EnableComments) { 0 Comments }

@Html.Raw(Model.SanitizeContent(Model.TrimContent(post.Body, out bool trimmed)))

}