feat: display webmaster in comments.

This commit is contained in:
Yufan Sheng 2024-07-03 01:13:06 +08:00
parent d0547aecda
commit e6d0b7ffdb
Signed by: syhily
GPG Key ID: DEB186763C308C31
3 changed files with 12 additions and 2 deletions

View File

@ -894,7 +894,8 @@
background-color: var(--bg-warning);
}
.badge-light {
.badge-light,
.badge-primary:hover {
color: var(--color-secondary);
background-color: var(--btn-light);
}

View File

@ -1,7 +1,8 @@
---
import type { CommentItem } from '@/components/comment/types';
import { formatLocalDate } from '@/helpers/formatter';
import { urlJoin } from '@/helpers/tools';
import { encodedEmail, urlJoin } from '@/helpers/tools';
import options from '@/options';
interface Props {
depth: number;
@ -36,6 +37,13 @@ const { comment, depth, pending } = Astro.props;
</a>
)
}
{
encodedEmail(options.author.email) === comment.email_encrypted && (
<a class="badge badge-primary badge-pill" href={`mailto:${options.author.email}`}>
站长
</a>
)
}
</div>
<div class="comment-content">
<Fragment set:html={comment.content} />

View File

@ -4,6 +4,7 @@ export interface Comment {
content: string;
nick: string;
user_id: number;
email_encrypted: string;
link: string;
date: string;
rid: number;