Sort articles

master
Fabien Freling 2019-06-20 10:08:04 +02:00
parent e32c8fa862
commit f2bc1d34d0
1 changed files with 3 additions and 7 deletions

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