Fix comment link

This commit is contained in:
Kitaiti Makoto 2022-01-03 02:06:59 +09:00
parent f0e7ea5640
commit bac373a818

View file

@ -6,6 +6,7 @@
@if let Some(comm) = Some(&comment_tree.comment) { @if let Some(comm) = Some(&comment_tree.comment) {
@if let Ok(author) = comm.get_author(ctx.0) { @if let Ok(author) = comm.get_author(ctx.0) {
@* comment-@comm.id is used for link *@
<div class="comment u-comment h-cite" id="comment-@comm.id"> <div class="comment u-comment h-cite" id="comment-@comm.id">
<main class="content"> <main class="content">
<header> <header>
@ -15,8 +16,9 @@
<small>@author.fqn</small> <small>@author.fqn</small>
</a> </a>
<p class="dt-published" datetime="@comm.creation_date.format("%F %T")"> <p class="dt-published" datetime="@comm.creation_date.format("%F %T")">
@if let Some(ref ap_url) = comm.ap_url { @if let Ok(post) = comm.get_post(ctx.0) {
<a class="u-url" href="@ap_url">@comm.creation_date.format("%B %e, %Y %H:%M")</a> @* comment-@comm.id is same to this div's id attribute *@
<a class="u-url" href="@post.ap_url#comment-@comm.id">@comm.creation_date.format("%B %e, %Y %H:%M")</a>
} }
</p> </p>