generate folders multi blogs multi langs

This commit is contained in:
Tykayn 2024-11-03 11:18:48 +01:00 committed by tykayn
parent 2bcb27cd36
commit 0832d29f27

View File

@ -4,15 +4,33 @@ 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
@ -20,9 +38,13 @@ generate_website() {
# 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