From f40c4c45f91a8e5c26df915e28ed5e8413bc6f43 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Sun, 10 Nov 2024 00:16:15 +0100 Subject: [PATCH] up style and template --- converters.sh | 3 +- enrich_html.py | 22 ++++- .../index.html | 17 +--- .../index.html | 17 +--- .../index.html | 10 +- .../index.html | 96 +++++++++---------- .../index.html | 4 +- .../2024/20241109231110-tags/index.html | 4 +- .../index.html | 5 +- html-websites/cipherbliss_blog/style.css | 3 +- .../cipherbliss_blog/converted/contact.html | 5 +- sources/cipherbliss_blog/converted/index.html | 5 +- .../2024-11-03-creation-of-a-gemini-blog.html | 4 +- ...ogramme-pour-une-annee-2022-moins-pire.org | 56 ++++++++--- ..._des-sauvegardes-qui-durent-mille-ans.html | 4 +- ...liss_blog_239_nouvelles-doctobre-2021.html | 4 +- ...40_video-du-premier-chatons-camp-2021.html | 4 +- ...gramme-pour-une-annee-2022-moins-pire.html | 96 +++++++++---------- ...9230937-ressources-de-café-vie-privée.html | 4 +- .../converted/20241109231110-tags.html | 4 +- ...s-jours-edf-tempo-en-ligne-de-commande.html | 5 +- templates/styles/style_general.css | 3 +- templates/styles/style_general.css.map | 2 +- templates/styles_src/style_general.scss | 6 +- 24 files changed, 194 insertions(+), 189 deletions(-) diff --git a/converters.sh b/converters.sh index 562d9125..c232c864 100755 --- a/converters.sh +++ b/converters.sh @@ -49,7 +49,8 @@ convert_sources() { echo "----------- conversion vers converted/${i%.${source_file_extension}}.html" - pandoc -f "${source_file_extension}" -t html -s "${i}" -o "converted/${i%.${source_file_extension}}.html" --metadata title="$website_name" + pandoc -f "${source_file_extension}" -t html -s "${i}" -o "converted/${i%.${source_file_extension}}.html" + # --metadata title="$website_name" # --------------------------------------- Transformer en gmi --------------------------------------- # echo "----------- to GMI:" # pwd diff --git a/enrich_html.py b/enrich_html.py index 1368ec36..9083affc 100755 --- a/enrich_html.py +++ b/enrich_html.py @@ -1,7 +1,7 @@ #!/bin/python3 import os import argparse - +import re parser = argparse.ArgumentParser(description="Générer un site Web à partir de fichiers HTML.") parser.add_argument("blog_name", help="Le chemin vers le dossier contenant les fichiers HTML.") @@ -37,6 +37,22 @@ BANNIERE_ENTETE_ALT='bannière du site' ARTICLE='' FOOTER='' +def remove_properties_section(text): + pattern = r"

Article

.+?" + replacement = "" + return re.sub(pattern, replacement, text, flags=re.DOTALL) + +def remove_article_head_properties_orgmode(text): + pattern = r":PROPERTIES:.+?:END:" + replacement = "" + return re.sub(pattern, replacement, text, flags=re.DOTALL) + +def remove_hint_html(text): + pattern = r"

ceciestduhtml

" + replacement = "" + return re.sub(pattern, replacement, text, flags=re.DOTALL) + + def enrich_one_file(file, root_path): @@ -56,6 +72,10 @@ def enrich_one_file(file, root_path): with open(os.path.join(root_path, file), "r") as f: html_content = f.read() + html_content = remove_properties_section(html_content) + html_content = remove_article_head_properties_orgmode(html_content) + html_content = remove_hint_html(html_content) + if inline_the_css: print(' ----------- include css inline in each html page') with open(os.path.join(root_path, file), "r") as f: diff --git a/html-websites/cipherbliss_blog/2021/cipherbliss_blog_238_des-sauvegardes-qui-durent-mille-ans/index.html b/html-websites/cipherbliss_blog/2021/cipherbliss_blog_238_des-sauvegardes-qui-durent-mille-ans/index.html index c61309a4..4a2cef69 100644 --- a/html-websites/cipherbliss_blog/2021/cipherbliss_blog_238_des-sauvegardes-qui-durent-mille-ans/index.html +++ b/html-websites/cipherbliss_blog/2021/cipherbliss_blog_238_des-sauvegardes-qui-durent-mille-ans/index.html @@ -22,7 +22,7 @@ - cipherbliss_blog + des-sauvegardes-qui-durent-mille-ans -
-

cipherbliss_blog

-

Contact

où me trouver: //contact@cipherbliss.com//

diff --git a/sources/cipherbliss_blog/converted/index.html b/sources/cipherbliss_blog/converted/index.html index 4e49acb2..fc8354f3 100644 --- a/sources/cipherbliss_blog/converted/index.html +++ b/sources/cipherbliss_blog/converted/index.html @@ -4,7 +4,7 @@ - cipherbliss_blog + index -
-

cipherbliss_blog

-

Dragon blog land

[contact](contact.org)

Articles

diff --git a/sources/cipherbliss_blog/lang_en/converted/2024-11-03-creation-of-a-gemini-blog.html b/sources/cipherbliss_blog/lang_en/converted/2024-11-03-creation-of-a-gemini-blog.html index 3f903f3f..6e4556ee 100644 --- a/sources/cipherbliss_blog/lang_en/converted/2024-11-03-creation-of-a-gemini-blog.html +++ b/sources/cipherbliss_blog/lang_en/converted/2024-11-03-creation-of-a-gemini-blog.html @@ -4,7 +4,7 @@ - cipherbliss_blog + Creation of a gemini blog