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"
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 @@ -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 @@ -[contact](contact.org)