diff --git a/bots/publisher_bot.py b/bots/publisher_bot.py index 03c8146..117d39d 100644 --- a/bots/publisher_bot.py +++ b/bots/publisher_bot.py @@ -301,8 +301,32 @@ def build_full_html(article: dict, body_html: str, toc_html: str) -> str: if toc_html: html_parts.append(f'
{toc_html}
') html_parts.append(body_html) + + # 원문 출처 링크 + sources = article.get('sources', []) + source_url = article.get('source_url', '') + source_name = article.get('source_name', '') or article.get('source', '') + if sources or source_url: + html_parts.append('
') + html_parts.append('
') + html_parts.append('📌 원문 출처
') + seen = set() + if sources: + for src in sources: + url = src.get('url', '') + title = src.get('title', '') or url + if url and url not in seen: + seen.add(url) + html_parts.append(f'• {title}
') + if source_url and source_url not in seen: + label = source_name or source_url + html_parts.append(f'• {label}
') + html_parts.append('
') + if disclaimer: - html_parts.append(f'

{disclaimer}

') + html_parts.append(f'

{disclaimer}

') return '\n'.join(html_parts)