refais un feed à la main
This commit is contained in:
@@ -25,47 +25,12 @@ echo "## END"
|
||||
|
||||
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"
|
||||
|
||||
echo "## Build atom"
|
||||
|
||||
LAST_CHANGES=$(git log --pretty="format:" --name-only | grep "content/*" | grep ".html" | uniq | tac | head -10)
|
||||
echo "liste des 10 derniers fichiers qui ont changés : $LAST_CHANGES"
|
||||
|
||||
|
||||
ITEMS=""
|
||||
for change in $LAST_CHANGES
|
||||
do
|
||||
titre=$(awk -F"<h1>|</h1>" '{for(i=2;i<=NF;i+=2){print $i}}' RS="" $change)
|
||||
lien=https://elsif.fr/$(echo $change | awk '{gsub(/content\//, ""); print $1}')
|
||||
updated=$(date -Ins -r $change)
|
||||
#summary=$(xmllint --html --noent --xpath "//article" $change)
|
||||
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>
|
||||
|
||||
"
|
||||
done
|
||||
|
||||
|
||||
cat << EOF > $FEED_FILE
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title>Elsif.fr - Yannick François</title>
|
||||
<subtitle>les dernières mise à jour du site</subtitle>
|
||||
<link href="http://elsif.fr/" />
|
||||
<id>tag:elsif.fr</id>
|
||||
<updated>$(date -R)</updated>
|
||||
|
||||
$ITEMS
|
||||
</feed>
|
||||
EOF
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user