diff --git a/gather_tags_in_json.py b/gather_tags_in_json.py index dbbb9fdb..6d7a8c38 100644 --- a/gather_tags_in_json.py +++ b/gather_tags_in_json.py @@ -85,9 +85,6 @@ def generate_html_pages_for_all_tags(tag_to_files, html_output_folder): template = env.get_template('templates/html/tag.html.jinja') sorted_tags = sorted(tag_to_files.items()) - # tags_count = {tag: len(files) for tag, files in sorted_tags} - - for tag, files in tag_to_files.items(): @@ -103,9 +100,9 @@ def generate_html_pages_for_all_tags(tag_to_files, html_output_folder): # Rendre le template avec les données html_content = template.render(data) - - - html_file_path = os.path.join(html_output_folder, f"{tag}.html") + os.makedirs(os.path.join(html_output_folder, tag), exist_ok=True) + + html_file_path = os.path.join(html_output_folder, tag , "index.html") with open(html_file_path, 'w', encoding='utf-8') as html_file: html_file.write(html_content) diff --git a/linking_articles_prev_next.py b/linking_articles_prev_next.py index 30a29281..74bfef11 100644 --- a/linking_articles_prev_next.py +++ b/linking_articles_prev_next.py @@ -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'