Sort articles
This commit is contained in:
parent
e32c8fa862
commit
f2bc1d34d0
|
@ -7,9 +7,9 @@ cat << EOF
|
||||||
title: Articles
|
title: Articles
|
||||||
---
|
---
|
||||||
|
|
||||||
<ul>
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
listing=""
|
||||||
for file in *.md; do
|
for file in *.md; do
|
||||||
if [ $file = "index.md" ]; then
|
if [ $file = "index.md" ]; then
|
||||||
continue
|
continue
|
||||||
|
@ -18,10 +18,6 @@ for file in *.md; do
|
||||||
link=$(basename $file .md).html
|
link=$(basename $file .md).html
|
||||||
date=$(sed -n 's/date: \(.*\)/\1/p' $file)
|
date=$(sed -n 's/date: \(.*\)/\1/p' $file)
|
||||||
title=$(sed -n 's/title: \(.*\)/\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
|
done
|
||||||
|
echo -e $listing | sort --reverse
|
||||||
cat << EOF
|
|
||||||
</ul>
|
|
||||||
EOF
|
|
||||||
|
|
Loading…
Reference in a new issue