update
This commit is contained in:
@@ -67,9 +67,16 @@
|
||||
|
||||
<!-- Article Title -->
|
||||
<h2 style="margin: 12px 0 8px 0; font-size: 19px; font-weight: 700; line-height: 1.3; color: #1a1a1a;">
|
||||
{{ article.title }}
|
||||
{{ article.title_en if article.title_en else article.title }}
|
||||
</h2>
|
||||
|
||||
<!-- Original German Title (subtitle) -->
|
||||
{% if article.title_en and article.title_en != article.title %}
|
||||
<p style="margin: 0 0 12px 0; font-size: 13px; color: #999999; font-style: italic;">
|
||||
Original: {{ article.title }}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<!-- Article Meta -->
|
||||
<p style="margin: 0 0 12px 0; font-size: 13px; color: #999999;">
|
||||
<span style="color: #000000; font-weight: 600;">{{ article.source }}</span>
|
||||
|
||||
@@ -27,14 +27,25 @@ from services import tracking_service
|
||||
from tracking_integration import inject_tracking_pixel, replace_article_links, generate_tracking_urls
|
||||
|
||||
# Load environment variables from backend/.env
|
||||
backend_dir = Path(__file__).parent.parent / 'backend'
|
||||
env_path = backend_dir / '.env'
|
||||
# Try multiple locations (Docker vs local)
|
||||
env_locations = [
|
||||
Path('/app/.env'), # Docker location
|
||||
Path(__file__).parent.parent / 'backend' / '.env', # Local location
|
||||
Path(__file__).parent / '.env', # Current directory
|
||||
]
|
||||
|
||||
if env_path.exists():
|
||||
load_dotenv(dotenv_path=env_path)
|
||||
print(f"✓ Loaded configuration from: {env_path}")
|
||||
else:
|
||||
print(f"⚠ Warning: .env file not found at {env_path}")
|
||||
env_loaded = False
|
||||
for env_path in env_locations:
|
||||
if env_path.exists():
|
||||
load_dotenv(dotenv_path=env_path)
|
||||
print(f"✓ Loaded configuration from: {env_path}")
|
||||
env_loaded = True
|
||||
break
|
||||
|
||||
if not env_loaded:
|
||||
print(f"⚠ Warning: .env file not found in any of these locations:")
|
||||
for loc in env_locations:
|
||||
print(f" - {loc}")
|
||||
|
||||
|
||||
class Config:
|
||||
@@ -114,6 +125,8 @@ def get_latest_articles(max_articles=10, hours=24):
|
||||
|
||||
articles.append({
|
||||
'title': doc.get('title', ''),
|
||||
'title_en': doc.get('title_en'),
|
||||
'translated_at': doc.get('translated_at'),
|
||||
'author': doc.get('author'),
|
||||
'link': doc.get('link', ''),
|
||||
'summary': doc.get('summary', ''),
|
||||
|
||||
Reference in New Issue
Block a user