2024-06-14 02:11:26 +08:00
|
|
|
---
|
|
|
|
import { latestComments } from '@/helpers/db/query';
|
2024-06-19 03:34:36 +08:00
|
|
|
import options from '@/options';
|
2024-06-14 02:11:26 +08:00
|
|
|
|
|
|
|
const comments = await latestComments();
|
|
|
|
---
|
|
|
|
|
|
|
|
{
|
|
|
|
options.settings.sidebar.comment > 0 && (
|
|
|
|
<div id="recent-comments" class="widget widget_recent_comments">
|
|
|
|
<div class="widget-title">近期评论</div>
|
|
|
|
<ul id="recentcomments">
|
|
|
|
{comments.map((comment) => (
|
|
|
|
<li class="recentcomments">
|
|
|
|
<span class="comment-author-link">
|
|
|
|
{comment.authorLink === '' ? (
|
|
|
|
comment.author
|
|
|
|
) : (
|
|
|
|
<a href={comment.authorLink} target="_blank" rel="nofollow">
|
|
|
|
{comment.author}
|
|
|
|
</a>
|
|
|
|
)}
|
|
|
|
</span>
|
|
|
|
{'发表在《'}
|
|
|
|
<a href={comment.permalink}>{comment.title}</a>
|
|
|
|
{'》'}
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|