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

@ -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)

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

View file

@ -4,7 +4,7 @@
#+post_slug: organisation-de-taches-orgmode
#+post_url: https://www.ciperbliss.com/2024/ouiiii-heuuu-voilà
#+post_title: ouiiii heuuu voilà
#+post_tags:
#+post_tags: bidule, machin, truc
#+post_type: post
#+post_mime_types:
#+post_guid:

View file

@ -107,7 +107,6 @@
{{all_articles[article.next].title}}</div>
</a>
<!-- // TODO corriger les précédents et suivants, ajouter le titre -->
{% endif %}
</div>
<div class="retour-accueil">