update tags path

This commit is contained in:
Tykayn 2025-02-24 11:57:17 +01:00 committed by tykayn
parent 9d5c9ba9ea
commit c47d886ecc
4 changed files with 13 additions and 14 deletions

View file

@ -152,7 +152,8 @@ if generate_linkings_json :
gemini_content = ''
html_content = ''
# Vérifier l'existence du fichier HTML pour déterminer last_html_build
html_content_without_h1 = ''
# Vérifier l'existence du fichier HTML pour déterminer last_html_build
html_path = f"html-websites/{args.blog}/{annee}/{slug}/index.html"
last_html_build_time = None
if os.path.exists(html_path):
@ -198,11 +199,13 @@ if generate_linkings_json :
# Garder le contenu HTML existant si déjà présent
if f"{annee}/{slug}" in files_dict and 'html_content' in files_dict[f"{annee}/{slug}"]:
html_content = files_dict[f"{annee}/{slug}"]['html_content']
html_content_without_h1 = files_dict[f"{annee}/{slug}"]['html_content_without_h1']
else:
html_content_without_h1 = re.sub(r'<h1>.*?</h1>', '', html_content)
print('on reprend le contenu html existant')
if len(files_dict[f"{annee}/{slug}"]['html_content']) > 0:
html_content = files_dict[f"{annee}/{slug}"]['html_content']
if len(files_dict[f"{annee}/{slug}"]['html_content_without_h1']) > 0:
html_content_without_h1 = files_dict[f"{annee}/{slug}"]['html_content_without_h1']
else:
html_content_without_h1 = re.sub(r'<h1>.*?</h1>', '', html_content)
if run_pandoc and rebuild_this_article_html or force_html_regen:
# convertir le contenu d'article org vers html