Sort articles

This commit is contained in:
Fabien Freling 2019-06-20 10:08:04 +02:00
parent e32c8fa862
commit f2bc1d34d0

View file

@ -7,9 +7,9 @@ cat << EOF
title: Articles
---
<ul>
EOF
listing=""
for file in *.md; do
if [ $file = "index.md" ]; then
continue
@ -18,10 +18,6 @@ for file in *.md; do
link=$(basename $file .md).html
date=$(sed -n 's/date: \(.*\)/\1/p' $file)
title=$(sed -n 's/title: \(.*\)/\1/p' $file)
echo "<li>$date: <a href=\"$link\">$title</a></li>"
listing="$listing- $date: [$title]($link)\n"
done
cat << EOF
</ul>
EOF
echo -e $listing | sort --reverse