feat: add REACTIONS environment variable and integrate it into item component

This commit is contained in:
bunizao
2026-01-12 04:39:24 +08:00
parent 63f7dab32d
commit fbd6bbe018
2 changed files with 4 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ STATIC_PROXY=""
GOOGLE_SEARCH_SITE=""
TAGS=""
COMMENTS=""
REACTIONS=""
LINKS=""
NAVS=""
RSS_BEAUTIFY=""
RSS_BEAUTIFY=""

View File

@@ -14,6 +14,7 @@ const { post, isItem } = Astro.props
const channel = getEnv(import.meta.env, Astro, 'CHANNEL')
const COMMENTS = getEnv(import.meta.env, Astro, 'COMMENTS')
const REACTIONS = getEnv(import.meta.env, Astro, 'REACTIONS')
const datetime = dayjs(post.datetime).tz(timezone)
const timeago = datetime.isBefore(dayjs().subtract(1, 'w')) ? datetime.format('HH:mm · ll · ddd') : datetime.fromNow()
@@ -30,7 +31,7 @@ const timeago = datetime.isBefore(dayjs().subtract(1, 'w')) ? datetime.format('H
</div>
{post.content.length > 0 && <div class={`text-box content`} set:html={post.content} />}
{
post.reactions?.length > 0 && (
REACTIONS && post.reactions?.length > 0 && (
<div class="reaction-box">
<div class="reaction-list">
{post.reactions.map((reaction) => (