corrige la génération de page catégorie

This commit is contained in:
Yannick Francois
2020-03-15 01:05:39 +01:00
parent 33d604b0f6
commit 02a4bdc640
11 changed files with 78 additions and 60 deletions
+14 -22
View File
@@ -10,7 +10,10 @@ KEYWORDS=keywords.md
cat "" > $KEYWORDS
echo "## Generate HTML files for each markdown files"
for mdfile in $MARKDOWN_FILES; do
echo "-------------- current file $mdfile"
htmlfile="${mdfile%%.*}.html"
if [ ! -f "$htmlfile" ] || [ "$htmlfile" -ot "$mdfile" ]; then
echo "--> generate with pandoc '$htmlfile' from '$mdfile'"
@@ -19,28 +22,17 @@ for mdfile in $MARKDOWN_FILES; do
pandoc --template=lib/extract-keywords.md "$mdfile" >> $KEYWORDS
done
for line in $(cat $KEYWORDS); do
directory=content/$(echo $line | awk -F":" '{print $1}')
echo $directory
fichier=/$(echo $line | awk -F":" '{print $2}' | awk -F"content|index.md" '{print $1}')
echo $fichier
titre=$(echo $line | awk -F":" '{print $3}')
echo $titre
if [ ! -d $directory ]; then
mkdir -p $directory
fi
if [ ! -f $directory/index.md ]; then
touch $directory/index.md
else
echo "" > $directory/index.md
fi
echo "## END"
echo "- [$titre]($fichier)" >> $directory/index.md
echo "## Build keywords pages"
python build_theme_index.py
if [ ! -f "$htmlfile" ] || [ "$htmlfile" -ot "$mdfile" ]; then
echo "--> generate with pandoc '$htmlfile' from '$mdfile'"
pandoc --template=lib/template.html -c lib/pandoc.css "$mdfile" -o "$htmlfile"
fi
echo "## END"
pandoc --template=lib/template.html -c lib/pandoc.css "$directory/index.md" -o "$directory/index.html"
done
echo "Build atom"
echo "## Build atom"
LAST_CHANGES=$(git log --pretty="format:" --name-only | grep "content/posts/20*" | grep ".html" | uniq | tac | head -10)
echo "liste des 10 derniers fichiers qui ont changés : $LAST_CHANGES"
@@ -56,9 +48,9 @@ do
summary=""
ITEMS="$ITEMS
<entry xml:lang='fr'><title>$titre</title><link href='$lien' rel='alternate' type='text/html'/><updated>$updated</updated><id>tag:$(shasum $change | awk -F ' ' '{print $1}')</id><summary type='HTML'>$summary</summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
<entry xml:lang='fr'><title>$titre</title><link href='$lien' rel='alternate' type='text/html'/><updated>$updated</updated><id>tag:$(shasum $change | awk -F ' ' '{print $1}')</id><summary type='HTML'>$summary</summary><author><name>Yannick François</name><email>yaf@elsif.fr</email></author></entry>
"
"
done