index lié aux articles

This commit is contained in:
Tykayn 2025-02-19 22:52:44 +01:00 committed by tykayn
parent b31dcd6f8a
commit 7c88fb7314
2 changed files with 45 additions and 22 deletions

View file

@ -91,17 +91,6 @@ for basename, info in files_dict.items():
print(f"Nombre d'articles mis à jour après le 01 01 2024 : {count_articles_updated}")
# Afficher le dictionnaire pour vérification
# for basename, info in files_dict.items():
# print(f"Article: {basename}")
# print(f" Path: {info['path']}")
# print(f" tags: {info['tags']}")
# print(f" title: {info['title']}")
# print(f" Previous: {info['previous']}")
# print(f" Next: {info['next']}")
# print("-" * 40)
def generate_blog_index(json_file, template_file, output_file):
"""
Génère la page d'index du blog à partir des informations JSON et d'un template Jinja2.
@ -125,7 +114,8 @@ def generate_blog_index(json_file, template_file, output_file):
output_html = template.render(
template_content=configs_sites[args.blog],
articles=sorted_articles[:global_config['posts_per_page']],
articles_info=articles_info
articles_others=sorted_articles[10:]
)
# Écrire le fichier de sortie