feat: add HIDE_DESCRIPTION env variable to control TG description visibility

Co-authored-by: miantiao-me <2959393+miantiao-me@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-14 02:43:11 +00:00
parent 265113a44b
commit a3b8c97bc3
2 changed files with 3 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ HEADER_INJECT=HEADER_INJECT
NO_FOLLOW=false NO_FOLLOW=false
NO_INDEX=false NO_INDEX=false
HIDE_DESCRIPTION=false
TELEGRAM_HOST=telegram.dog TELEGRAM_HOST=telegram.dog
STATIC_PROXY="" STATIC_PROXY=""

View File

@@ -22,6 +22,7 @@ const MASTODON = getEnv(import.meta.env, Astro, 'MASTODON')
const BLUESKY = getEnv(import.meta.env, Astro, 'BLUESKY') const BLUESKY = getEnv(import.meta.env, Astro, 'BLUESKY')
const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/' const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
const hideDescription = getEnv(import.meta.env, Astro, 'HIDE_DESCRIPTION')
--- ---
<div id="header"> <div id="header">
@@ -102,7 +103,7 @@ const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
</div> </div>
{ {
channel?.descriptionHTML && channel?.descriptionHTML.length > 0 && ( !hideDescription && channel?.descriptionHTML && channel?.descriptionHTML.length > 0 && (
<div class="text-box" id="site-intro" set:html={channel?.descriptionHTML} /> <div class="text-box" id="site-intro" set:html={channel?.descriptionHTML} />
) )
} }