@page @using Humanizer @using OliverBooth.Data.Blog @using OliverBooth.Services @model OliverBooth.Pages.Blog.Index @inject BlogService BlogService

Loading...

@foreach (BlogPost post in ArraySegment.Empty /*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");

@post.Title

@author?.Name @author?.Name • @(isUpdated ? "Updated" : "Published") @timestamp.Humanize() @if (post.EnableComments) { 0 Comments }

@Html.Raw(BlogService.GetExcerpt(post, out bool trimmed))

@if (trimmed) {

Read more...

}
}