feat: display webmaster in comments.

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

View File

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

View File

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

View File

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