#!/usr/bin/env python3 import os EXCLURE = ['html', 'Scripts', '__pycache__', '.git'] OUTPUT_FILE = "index.html" def generer_index_general(): road_trips = [] for d in sorted(os.listdir('.')): if os.path.isdir(d) and d not in EXCLURE: # On cherche mini.html en priorité if os.path.exists(os.path.join(d, 'mini.html')): road_trips.append(d) html_content = f""" Nos Road-Trips

🌍 Nos Road-Trips

""" for trip in road_trips: html_content += f"""

{trip.replace('-', ' ')}

Voir le voyage
""" html_content += "
" with open(OUTPUT_FILE, "w", encoding="utf-8") as f: f.write(html_content) if __name__ == "__main__": generer_index_general()