diff --git a/.gitignore b/.gitignore index 354bd26a..ce296efe 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ __pycache__ output/pictures output/*.org html-websites/* +gemini-capsules/* html-websites/**/* pictures_done pictures_inbox/* diff --git a/build_indexes.py b/build_indexes.py index d556e1e8..e437f3e5 100755 --- a/build_indexes.py +++ b/build_indexes.py @@ -40,7 +40,7 @@ def generer_index(dossier_source, fichier_index): # Chemin complet pour le fichier d'index chemin_fichier_index_gemini = os.path.join(dossier_parent, 'gemini-capsules', args.source, 'index.gmi') chemin_fichier_index_html = os.path.join(dossier_parent, 'html-websites', args.source, 'index.html') - + contenu_index_html = '' print('\n index html: ', chemin_fichier_index_html) # Génère le contenu du fichier d'index contenu_index_gmi = f"{config_title}\n{'- ' * len(config_title)}\n\n" @@ -78,6 +78,7 @@ def generer_index(dossier_source, fichier_index): # et le renommer en index.html ensuite pour ne pas modifier l'index du blog contenu_index_html += f"
{article_name}" os.makedirs(os.path.dirname(new_folder_path_this_article), exist_ok=True) + mylog(" -------- créer le dossier de l article ", new_folder_path_this_article) shutil.copy(chemin_fichier_this_article_html, new_folder_path_this_article + 'index.html') else: contenu_index_html += f"
{link_html}" diff --git a/converters.sh b/converters.sh index 7a354c01..a90e352b 100755 --- a/converters.sh +++ b/converters.sh @@ -38,7 +38,6 @@ convert_sources() { mkdir -p converted - pwd ls -l *.${source_file_extension} |wc -l for i in *.${source_file_extension} ; do @@ -63,7 +62,7 @@ convert_sources() { # Définition de la fonction generate_website generate_website() { echo "----------- convert_sources :Génération du site $1..." - + cp $style_file html-websites/$website_name/style.css if [ ! -d "sources/$website_name" ]; then @@ -105,18 +104,25 @@ generate_website() { # traduction en cd lang_en + pwd convert_sources ../ # echo "----------- pages en anglais du site web $website_name converties" - cd .. +# cd .. - cd .. - cd .. +# cd .. +# cd .. + echo " ____________________________________ " + echo " ____________________________________ " + echo " ____________________________________ " pwd - - cp $style_file html-websites/$website_name/style.css + echo " ____________________________________ " + echo " ____________________________________ " + echo " ____________________________________ " + + } @@ -174,6 +180,7 @@ convert_markdown_to_gmi() { echo "----------- génération des fichiers gemini faite." + pwd @@ -188,7 +195,8 @@ bash sass_styles.sh # Boucle à travers la liste des sites Web for website_name in "${blogs_folders[@]}"; do - + export website_name=$website_name + generate_website $website_name convert_markdown_to_gmi $website_name @@ -214,6 +222,7 @@ for website_name in "${blogs_folders[@]}"; do # traiter les réductions d'images dans l'inbox python3 pictures_resize.py + mkdir -p "html-websites/$website_name/feed" python3 atom_generate.py $website_name mv "index_$website_name.xml" "html-websites/$website_name/feed/index.xml" diff --git a/enrich_html.py b/enrich_html.py index 248a1c13..56393cd8 100755 --- a/enrich_html.py +++ b/enrich_html.py @@ -168,7 +168,8 @@ def ouvrir_fichier(chemin_fichier): contenu = fichier.read() return contenu else: - raise FileNotFoundError(f"Le fichier {chemin_fichier} n'existe pas.") + print(f"Le fichier {chemin_fichier} n'existe pas.") + return '' liste_fichiers_du_blog_convertis = os.walk(html_pages) mylog('fichiers à enrichir:', liste_fichiers_du_blog_convertis) diff --git a/pictures_resize.py b/pictures_resize.py index b0ed5de6..5b608789 100644 --- a/pictures_resize.py +++ b/pictures_resize.py @@ -79,7 +79,7 @@ for filename in os.listdir(INPUT_DIR): os.rename(input_image_path, done_image_path) # Écrire la ligne pour le document .org - org_line = f"\n\n[[file:{url_folder_pics}/{YEAR}/{small_image_name}][{filename}]]\n" + org_line = f"\n\n[[{url_folder_pics}/{YEAR}/{small_image_name}][{filename}]]\n" with open(os.path.join("output", f"images_{YEAR}.org"), "a") as org_file: org_file.write(org_line) diff --git a/sources/cil_gometz/converted/index.html b/sources/cil_gometz/converted/index.html deleted file mode 100644 index 5b1ecd22..00000000 --- a/sources/cil_gometz/converted/index.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - cil_gometz - - - -
-

cil_gometz

-
-
-

Les trucs d'un dragon qui roule plus vite à vélo tel un neutron -rapide, mais avec un casque opour le vélotaf chez Hexana.

-
-

À propos => a-propos.gmi

-

Projets => projets.gmi

-

Contact => contact.gmi

-

BlogRoll => blogroll.gmi

-
- - diff --git a/website_config.py b/website_config.py index 2020e1f2..ffdcfcb8 100644 --- a/website_config.py +++ b/website_config.py @@ -8,11 +8,11 @@ global_config = { "source_files_extension": "org", # controlled vocabulary to find tags automatically "auto_tag_terms": ["illustration", "tuto", "nsfw", "bd", "récit", "science", - "wtf","yaoi","yuri","sondage","entreprise","ai","photos", - "cosplay","festival","fanzine","manif","logiciel","inktober", - "kotlife","féminisme","fantasme","art","sociologie","couple","masturbation", - "boobs","sortirDesFossiles","électrique","maison","GTD","chat","PIM", - "openstreetmap","sauvegarde","mastodon","voyages","bouffe"] + "wtf", "yaoi", "yuri", "sondage", "entreprise", "ai", "photos", + "cosplay", "festival", "fanzine", "manif", "logiciel", "inktober", + "kotlife", "féminisme", "fantasme", "art", "sociologie", "couple", "masturbation", + "boobs", "sortirDesFossiles", "électrique", "maison", "GTD", "chat", "PIM", + "openstreetmap", "sauvegarde", "mastodon", "voyages", "bouffe"] } configs_sites = { "cipherbliss_blog": { @@ -73,4 +73,82 @@ configs_sites = { "BANNIERE_ENTETE": "https://tykayn.fr/wp-content/themes/toivo-lite/images/header.jpg", "BANNIERE_ENTETE_ALT": "Bannière du site", }, + "cil_gometz": { + "DOSSIER_SOURCE": "tykayn_blog", + "NDD_GEMINI": "gemini.cil-gometz.org", + "BANNIERE_ENTETE": "", + "BLOG_TITLE": "Cil gometz", + "BLOG_SUBTITLE": "Cil gometz", + "TITLE": "", + "AUTHOR": "Cil gometz", + "PAGE_TITLE": "Cil gometz", + "LOCALE": "fr_FR", # la langue principale + "DESCRIPTION": "Cil gometz", + "NDD": "https://cil-gometz.org", + "EMAIL": "contact@cipherbliss.com", + "SITE_ICON": "https://mastodon.cipherbliss.com/system/accounts/avatars/000/000/001/original/6388tykayn.gif", + "SITE_ICON_TYPE": "image/png", + "NAVIGATION": """ + + """, + "BANNIERE_ENTETE": "https://tykayn.fr/wp-content/themes/toivo-lite/images/header.jpg", + "BANNIERE_ENTETE_ALT": "Bannière du site", + }, + "qzine_blog": { + "DOSSIER_SOURCE": "qzine_blog", + "NDD_GEMINI": "source.qzine.fr", + "BANNIERE_ENTETE": "", + "BLOG_TITLE": "!Qzine", + "BLOG_SUBTITLE": "La culture avec un grand !Q", + "TITLE": "", + "AUTHOR": "Tykayn", + "PAGE_TITLE": "Qzine", + "LOCALE": "fr_FR", # la langue principale + "DESCRIPTION": "Illustrations, articles de sociologie et récits autour des vies sexuelles contemporaines", + "NDD": "https://qzine.fr", + "EMAIL": "contact@qzine.fr", + "SITE_ICON": "https://mastodon.cipherbliss.com/system/accounts/avatars/000/000/001/original/6388tykayn.gif", + "SITE_ICON_TYPE": "image/png", + "NAVIGATION": """ + + """, + "BANNIERE_ENTETE": "https://tykayn.fr/wp-content/themes/toivo-lite/images/header.jpg", + "BANNIERE_ENTETE_ALT": "Bannière du site", + }, + "helia_blog": { + "DOSSIER_SOURCE": "helia_blog", + "NDD_GEMINI": "source.helia.tykayn.fr", + "BANNIERE_ENTETE": "", + "BLOG_TITLE": "Hélia Blog", + "BLOG_SUBTITLE": "Yaya blog, les prémices parentales, puis sa vie et son oeuvre.", + "TITLE": "", + "AUTHOR": "Tykayn & Claire", + "PAGE_TITLE": "Hélia Blog", + "LOCALE": "fr_FR", # la langue principale + "DESCRIPTION": "Textes et photos", + "NDD": "https://helia.tykayn.fr", + "EMAIL": "contact@cipherbliss.com", + "SITE_ICON": "https://mastodon.cipherbliss.com/system/accounts/avatars/000/000/001/original/6388tykayn.gif", + "SITE_ICON_TYPE": "image/png", + "NAVIGATION": """ + + """, + "BANNIERE_ENTETE": "https://tykayn.fr/wp-content/themes/toivo-lite/images/header.jpg", + "BANNIERE_ENTETE_ALT": "Bannière du site", + }, }