style: add alt to author image, reorder anchor attrs

This commit is contained in:
Oliver Booth 2023-08-08 21:01:13 +01:00
parent 77288a0ab5
commit 0fa43704ea
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61
2 changed files with 22 additions and 11 deletions

View File

@ -1,5 +1,6 @@
@page "/blog/{year:int}/{month:int}/{day:int}/{slug}" @page "/blog/{year:int}/{month:int}/{day:int}/{slug}"
@using Humanizer @using Humanizer
@using OliverBooth.Data.Blog
@using OliverBooth.Services @using OliverBooth.Services
@model OliverBooth.Pages.Blog.Article @model OliverBooth.Pages.Blog.Article
@inject BlogService BlogService @inject BlogService BlogService
@ -9,6 +10,11 @@
return; return;
} }
@{
Author author = Model.Author;
DateTimeOffset published = post.Published;
}
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb"> <nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"> <li class="breadcrumb-item">
@ -20,12 +26,13 @@
<h1>@post.Title</h1> <h1>@post.Title</h1>
<p class="text-muted"> <p class="text-muted">
<img class="blog-author-icon" src="https://gravatar.com/avatar/@Model.Author?.AvatarHash?s=28"> <img class="blog-author-icon" src="https://gravatar.com/avatar/@author.AvatarHash?s=28" alt="@author.Name">
@Model.Author?.Name @author.Name &bull;
&bull;
<abbr data-bs-toggle="tooltip" data-bs-title="@post.Published.ToString("f")"> <abbr data-bs-toggle="tooltip" data-bs-title="@published.ToString("f")">
Published @post.Published.Humanize() Published @published.Humanize()
</abbr> </abbr>
@if (post.Updated is { } updated) @if (post.Updated is { } updated)
{ {
<span>&bull;</span> <span>&bull;</span>
@ -33,6 +40,7 @@
Updated @updated.Humanize() Updated @updated.Humanize()
</abbr> </abbr>
} }
@if (post.EnableComments) @if (post.EnableComments)
{ {
<span>&bull;</span> <span>&bull;</span>
@ -40,6 +48,7 @@
} }
</p> </p>
<article> <article>
@Html.Raw(BlogService.GetContent(post)) @Html.Raw(BlogService.GetContent(post))
</article> </article>

View File

@ -1,4 +1,4 @@
@page @page
@using Humanizer @using Humanizer
@using OliverBooth.Data.Blog @using OliverBooth.Data.Blog
@using OliverBooth.Services @using OliverBooth.Services
@ -28,21 +28,23 @@
</h2> </h2>
<p class="text-muted"> <p class="text-muted">
<img class="blog-author-icon" src="https://gravatar.com/avatar/@author?.AvatarHash?s=28"> <img class="blog-author-icon" src="https://gravatar.com/avatar/@author?.AvatarHash?s=28" alt="@author?.Name">
@author?.Name @author?.Name &bull;
&bull;
<abbr data-bs-toggle="tooltip" data-bs-title="@timestamp.ToString("f")"> <abbr data-bs-toggle="tooltip" data-bs-title="@timestamp.ToString("f")">
@(isUpdated ? "Updated" : "Published") @timestamp.Humanize() @(isUpdated ? "Updated" : "Published") @timestamp.Humanize()
</abbr> </abbr>
@if (post.EnableComments) @if (post.EnableComments)
{ {
<span>&bull;</span> <span> &bull;</span>
<a asp-page="/blog/article" <a asp-page="/blog/article"
asp-fragment="disqus_thread"
asp-route-year="@year" asp-route-year="@year"
asp-route-month="@month" asp-route-month="@month"
asp-route-day="@day" asp-route-day="@day"
asp-route-slug="@post.Slug" asp-route-slug="@post.Slug"
asp-fragment="disqus_thread" data-disqus-identifier="@post.GetDisqusIdentifier()"> data-disqus-identifier="@post.GetDisqusIdentifier()">
0 Comments 0 Comments
</a> </a>
} }