Don't include title within markdown blog posts

main
Bob Mottram 2025-12-27 22:45:22 +00:00
parent a8f33d0296
commit 55460a5b94
1 changed files with 1 additions and 9 deletions

View File

@ -15,7 +15,6 @@ from utils import get_base_content_from_post
from utils import get_post_attachments from utils import get_post_attachments
from utils import get_url_from_post from utils import get_url_from_post
from utils import get_markdown_blog_filename from utils import get_markdown_blog_filename
from utils import get_gemini_blog_title
from utils import get_gemini_blog_published from utils import get_gemini_blog_published
@ -539,9 +538,6 @@ def blog_to_markdown(base_dir: str, nickname: str, domain: str,
return False return False
content_text = remove_html(content_str) content_text = remove_html(content_str)
# get the blog title
title_text = get_gemini_blog_title(message_json, system_language)
# create markdown blog directory # create markdown blog directory
if not testing: if not testing:
markdown_blog_dir = account_dir + '/markdown' markdown_blog_dir = account_dir + '/markdown'
@ -555,9 +551,6 @@ def blog_to_markdown(base_dir: str, nickname: str, domain: str,
message_json, system_language, message_json, system_language,
debug, testing) debug, testing)
if not title_text.startswith('# '):
title_text = '# ' + title_text
# get attachments # get attachments
links: list[str] = [] links: list[str] = []
post_attachments = get_post_attachments(message_json) post_attachments = get_post_attachments(message_json)
@ -582,8 +575,7 @@ def blog_to_markdown(base_dir: str, nickname: str, domain: str,
try: try:
with open(markdown_blog_filename, 'w+', with open(markdown_blog_filename, 'w+',
encoding='utf-8') as fp_markdown: encoding='utf-8') as fp_markdown:
fp_markdown.write(title_text + '\n\n' + published + '\n\n' + fp_markdown.write(published + '\n\n' + content_text)
content_text)
except OSError: except OSError:
print('EX: blog_to_markdown unable to write ' + markdown_blog_filename) print('EX: blog_to_markdown unable to write ' + markdown_blog_filename)
return False return False