mirror of
https://forge.chapril.org/tykayn/orgmode-to-gemini-blog
synced 2025-06-20 09:04:42 +02:00
build with latest articles on homepage
This commit is contained in:
parent
e6ec57e576
commit
579e9116b7
22 changed files with 1013 additions and 3544 deletions
|
@ -9,26 +9,46 @@ if [ "$1" == "" ]; then
|
|||
fi
|
||||
|
||||
|
||||
count_derniers_billets=10
|
||||
count_derniers_billets=4
|
||||
dossier=$1
|
||||
output_orgfile_list_billets="sources/$dossier/build/latests_posts.org"
|
||||
langue_liste="fr"
|
||||
|
||||
# Concaténer les noms des fichiers et écrire le résultat dans un fichier
|
||||
mkdir "sources/$dossier/build"
|
||||
mkdir -p "sources/$dossier/build"
|
||||
touch "sources/$dossier/build/latests_posts.org"
|
||||
touch "sources/$dossier/build/latests_posts_fr.org"
|
||||
touch "sources/$dossier/build/latests_posts_en.org"
|
||||
echo "" > "$output_orgfile_list_billets"
|
||||
|
||||
# concaténer les derniers billets en date pour faire une page d'accueil du blog
|
||||
|
||||
# Réinitialisation du fichier de sortie
|
||||
> "sources/$dossier/build/latests_posts.org"
|
||||
echo "" > "sources/$dossier/build/latests_posts.org"
|
||||
|
||||
# Récupération des derniers billets
|
||||
echo "billets sur la page d'accueil : $count_derniers_billets"
|
||||
ls -nr sources/$dossier/lang_fr/*.org | head -n $count_derniers_billets
|
||||
# ls -n sources/$dossier/lang_en/*.org | head -n $count_derniers_billets
|
||||
# Récupération des derniers billets pour chaque langue
|
||||
# les billets org doivent avoir un préfixe de date dans le nom de fichier afin d'etre rangés par date
|
||||
for file in $(ls -nr sources/$dossier/lang_fr/*.org | head -n $count_derniers_billets); do
|
||||
cat "$file" >> "sources/$dossier/build/latests_posts.org"
|
||||
echo "" >> "sources/$dossier/build/latests_posts.org" # Ajout d'une ligne vide entre les billets
|
||||
if [ -f "$file" ]; then
|
||||
|
||||
cat "$file" >> "$output_orgfile_list_billets"
|
||||
echo "$file";
|
||||
|
||||
echo "---------------" >> "$output_orgfile_list_billets" # Ajout d'une ligne vide entre les billets
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
echo "Les $count_derniers_billets derniers billets ont été concaténés dans $output_orgfile_list_billets"
|
||||
|
||||
pandoc "$output_orgfile_list_billets" -o "sources/$dossier/build/latests_posts.html"
|
||||
# cp "sources/$dossier/build/latests_posts_$langue_liste.org" "sources/$dossier/build/latests_posts.org"
|
||||
#
|
||||
pandoc "$output_orgfile_list_billets" -o "sources/$dossier/build/latests_posts.html"
|
||||
#
|
||||
echo "conversion en html ok. Consulter le rendu:"
|
||||
echo " "
|
||||
echo "firefox \"sources/$dossier/build/latests_posts.html\""
|
||||
echo " "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue