From 63d51307d539b199cf52ab335fe263b7ae7e6dd0 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Fri, 15 Nov 2024 23:55:20 +0100 Subject: [PATCH] unify slugs --- build_indexes.py | 10 +- enrich_html.py | 2 +- html-websites/cipherbliss_blog/contact.html | 2 +- html-websites/cipherbliss_blog/index.html | 6 +- html-websites/cipherbliss_blog/style.css | 7 +- html-websites/tykayn_blog/style.css | 7 +- .../index.html | 201 ----------- .../index.html | 313 ------------------ .../index.html | 214 ------------ .../index.html | 175 ---------- .../2024/10-tags/index.html | 218 ------------ .../index.html | 220 ------------ .../index.html | 237 ------------- .../56_cipherbliss_blog_soutien/index.html | 182 ---------- .../2024/58-ça-déménage/index.html | 177 ---------- html-websitescipherbliss_blog/None/index.html | 201 ----------- ...erbliss_blog_création-d'un-blog-gemini.org | 9 +- templates/styles/style_general.css | 7 +- templates/styles/style_general.css.map | 2 +- templates/styles_src/style_general.scss | 9 +- testing.py | 31 +- utils.py | 37 ++- 22 files changed, 90 insertions(+), 2177 deletions(-) delete mode 100644 html-websitescipherbliss_blog/2011/59_cipherbliss_blog_120_bienvenue-sur-informageek/index.html delete mode 100644 html-websitescipherbliss_blog/2024/03-connaître-la-couleur-des-jours-edf-tempo-en-ligne-de-commande/index.html delete mode 100644 html-websitescipherbliss_blog/2024/04_cipherbliss_blog_techniques-pour-planter-votre-association-ou-votre-entreprise/index.html delete mode 100644 html-websitescipherbliss_blog/2024/05_cipherbliss_blog_suivi-de-rédaction-de-livre-orgmode/index.html delete mode 100644 html-websitescipherbliss_blog/2024/10-tags/index.html delete mode 100644 html-websitescipherbliss_blog/2024/37-ressources-de-café-vie-privée/index.html delete mode 100644 html-websitescipherbliss_blog/2024/56_cipherbliss_blog_création-d'un-blog-gemini/index.html delete mode 100644 html-websitescipherbliss_blog/2024/56_cipherbliss_blog_soutien/index.html delete mode 100644 html-websitescipherbliss_blog/2024/58-ça-déménage/index.html delete mode 100644 html-websitescipherbliss_blog/None/index.html diff --git a/build_indexes.py b/build_indexes.py index f49e3ec0..55bac333 100755 --- a/build_indexes.py +++ b/build_indexes.py @@ -55,12 +55,11 @@ def generer_index(dossier_source, fichier_index): # ----------- indexer les articles en Français ------------------ for fichier in files_fr: - date_string, année, slug = find_year_and_slug(fichier) + # date_string, année, slug = find_year_and_slug(fichier) contenu_index_gmi += f"=> {fichier}\n" link_html = fichier.replace('.gmi', '.html') chemin_fichier_this_article_html = chemin_dossier_source + '/lang_fr/converted/' + link_html - chemin_fichier_this_article_html = chemin_dossier_source + '/lang_fr/converted/' + link_html link_org = fichier.replace('.gmi', '.org') file_path_org = os.path.join(dossier_parent, "sources", website_name, lang_folder, link_org) @@ -70,15 +69,14 @@ def generer_index(dossier_source, fichier_index): article_relative_url = detect_slug_in_file_basename(basename_file) if not article_name: - article_name = slug.replace('-', ' ') + article_name = article_relative_url.replace('-', ' ') if global_config["slug_with_year"]: - new_folder = article_relative_url - new_folder_path_this_article = os.path.join(dossier_parent, f"html-websites{args.source}/{new_folder}/") + new_folder_path_this_article = os.path.join(dossier_parent, f"html-websites/{args.source}/{article_relative_url}/") # déplacer le fichier html dans le dossier slug, # et le renommer en index.html ensuite pour ne pas modifier l'index du blog - contenu_index_html += f"
{année} {article_name}" + contenu_index_html += f"
{article_name}" os.makedirs(os.path.dirname(new_folder_path_this_article), exist_ok=True) shutil.copy(chemin_fichier_this_article_html, new_folder_path_this_article + 'index.html') else: diff --git a/enrich_html.py b/enrich_html.py index a27d7810..2c1f0389 100755 --- a/enrich_html.py +++ b/enrich_html.py @@ -108,7 +108,7 @@ def enrich_one_file(html_content: str, partials: dict = {"header_page": "", "foo