oliverbooth.dev/OliverBooth/Pages/Blog/Index.cshtml

27 lines
699 B
Plaintext
Raw Normal View History

@page
@using OliverBooth.Common.Data
@using OliverBooth.Common.Data.Blog
@using OliverBooth.Common.Services
@model Index
@inject IBlogPostService BlogPostService
@{
ViewData["Title"] = "Blog";
}
@await Html.PartialAsync("Partials/_MastodonStatus")
2024-04-27 16:03:06 +01:00
<div id="all-blog-posts">
2024-07-15 19:38:56 +01:00
@foreach (IBlogPost post in BlogPostService.GetBlogPosts(0, tags: Model.Tag))
{
@await Html.PartialAsync("Partials/_BlogCard", post)
}
2024-04-27 16:03:06 +01:00
</div>
@await Html.PartialAsync("Partials/_PageTabs", new ViewDataDictionary(ViewData)
{
["UrlRoot"] = "/blog",
["Page"] = 1,
2024-07-15 19:38:56 +01:00
["Tags"] = Model.Tag,
["PageCount"] = BlogPostService.GetPageCount(visibility: Visibility.Published, tags: Model.Tag)
})