From 0832d29f27f0f170ce9428af25794951dfd7526d Mon Sep 17 00:00:00 2001 From: Tykayn Date: Sun, 3 Nov 2024 11:18:48 +0100 Subject: [PATCH] generate folders multi blogs multi langs --- converters.sh | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/converters.sh b/converters.sh index d4619f6b..2f2c348f 100644 --- a/converters.sh +++ b/converters.sh @@ -4,25 +4,47 @@ cd source mkdir -p converted # liste des dossiers à convertir -blogs_folders=("dragonfeu") +blogs_folders=("dragonfeu_blog" "tykayn_blog" "cipherbliss_blog") source_file_extension="org" +convert_sources(){ + source_file_extension="org" + + mkdir converted + + # trasnformer en html + for i in *.$source_file_extension ; do echo "$i" && pandoc -f $source_file_extension -t html -s $i -o $i.html ; done + # transformer en gmi + for i in *.$source_file_extension ; + do echo "$i" && pandoc --template ../template_gemini.lua -f $source_file_extension -t ../gmi.lua -s $i -o $i.gmi ; + cat '../website_pages/footer-articles.md.gmi' >>  $i.gmi ; + done +} + # Définition de la fonction generate_website generate_website() { echo " Génération du site $1..." - mkdir gemini-capsules/$website_name - mkdir html-websites/$website_name + + mkdir -p gemini-capsules/$website_name + mkdir -p html-websites/$website_name + mkdir -p sources/$website_name/img + mkdir -p sources/$website_name/lang_fr + mkdir -p sources/$website_name/lang_en mv source/converted/*.gmi gemini-capsules/$website_name mv source/converted/*.html gemini-capsules/$website_name # Ajoutez ici le code pour générer le site Web echo "Le site $1 a été généré avec succès." - - for i in *.$source_file_extension ; do echo "$i" && pandoc -f $source_file_extension -t markdown -s $i -o $i.md ; done - for i in *.$source_file_extension ; do echo "$i" && pandoc -f $source_file_extension -t html -s $i -o $i.html ; done - for i in *.$source_file_extension ; do echo "$i" && pandoc --template ../template_gemini.lua -f $source_file_extension -t ../gmi.lua -s $i -o $i.gmi ; cat '../website_pages/footer-articles.md.gmi' >>  $i.gmi ; done + + convert_sources + #déplacer dans le site généré + cd lang_fr + convert_sources + cd lang_en + convert_sources + mv *.md converted mv *.html converted mv *.gmi converted