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

View File

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