generate folders multi blogs multi langs
This commit is contained in:
parent
2bcb27cd36
commit
0832d29f27
@ -4,15 +4,33 @@ cd source
|
|||||||
mkdir -p converted
|
mkdir -p converted
|
||||||
|
|
||||||
# liste des dossiers à convertir
|
# liste des dossiers à convertir
|
||||||
blogs_folders=("dragonfeu")
|
blogs_folders=("dragonfeu_blog" "tykayn_blog" "cipherbliss_blog")
|
||||||
source_file_extension="org"
|
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
|
# Définition de la fonction generate_website
|
||||||
generate_website() {
|
generate_website() {
|
||||||
echo " Génération du site $1..."
|
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/*.gmi gemini-capsules/$website_name
|
||||||
mv source/converted/*.html 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
|
# Ajoutez ici le code pour générer le site Web
|
||||||
echo "Le site $1 a été généré avec succès."
|
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
|
convert_sources
|
||||||
for i in *.$source_file_extension ; do echo "$i" && pandoc -f $source_file_extension -t html -s $i -o $i.html ; done
|
#déplacer dans le site généré
|
||||||
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
|
cd lang_fr
|
||||||
|
convert_sources
|
||||||
|
cd lang_en
|
||||||
|
convert_sources
|
||||||
|
|
||||||
mv *.md converted
|
mv *.md converted
|
||||||
mv *.html converted
|
mv *.html converted
|
||||||
mv *.gmi converted
|
mv *.gmi converted
|
||||||
|
Loading…
Reference in New Issue
Block a user