@page @using Humanizer @using OliverBooth.Data.Blog @using OliverBooth.Services @model OliverBooth.Pages.Blog.Index @inject BlogService BlogService @foreach (BlogPost post in BlogService.AllPosts) { BlogService.TryGetAuthor(post, out Author? author); DateTimeOffset published = post.Published; DateTimeOffset timestamp = post.Updated ?? published; bool isUpdated = post.Updated.HasValue; var year = published.ToString("yyyy"); var month = published.ToString("MM"); var day = published.ToString("dd");
@author?.Name • @(isUpdated ? "Updated" : "Published") @timestamp.Humanize() @if (post.EnableComments) { • 0 Comments }
@Html.Raw(BlogService.GetExcerpt(post, out bool trimmed))