Merge pull request #123 from miantiao-me/copilot/add-env-variable-tg-intro

feat: add HIDE_DESCRIPTION env variable to control TG description visibility
This commit is contained in:
面条
2025-12-14 11:14:13 +08:00
committed by GitHub
4 changed files with 9 additions and 1 deletions

View File

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

View File

@@ -110,6 +110,9 @@ HEADER_INJECT=HEADER_INJECT
NO_FOLLOW=false
NO_INDEX=false
## Hide Telegram channel description
HIDE_DESCRIPTION=false
## Sentry configuration options, collect server-side errors
SENTRY_AUTH_TOKEN=SENTRY_AUTH_TOKEN
SENTRY_DSN=SENTRY_DSN

View File

@@ -108,6 +108,9 @@ HEADER_INJECT=HEADER_INJECT
NO_FOLLOW=false
NO_INDEX=false
## 隐藏 Telegram 频道简介
HIDE_DESCRIPTION=false
## Sentry 配置项,收集服务端报错
SENTRY_AUTH_TOKEN=SENTRY_AUTH_TOKEN
SENTRY_DSN=SENTRY_DSN

View File

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