commit 57f783cdfbdfbfd3dfa30da9adb7bba88da0ecd5
parent ccc471008c6897d22d0fe318e214c21f9a971656
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Thu, 29 Dec 2022 23:18:51 +0100
Added year to blog index
Diffstat:
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/build.sh b/build.sh
@@ -61,6 +61,13 @@ makeblog() {
f="src/blog/$i/*.md"
d=$(echo $i | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}')
t=$(head -n 1 $f | sed 's/# //')
+
+ thisyear=$(echo $d | sed 's/-.*//')
+ if [ "$thisyear" != "$lastyear" ]; then
+ printf "\n## $thisyear\n\n" >> $bf
+ lastyear=$thisyear
+ fi
+
echo "* $d [$t]($i)" >> $bf
echo "<item>" >> $ff
@@ -86,6 +93,12 @@ gemblog() {
if [ -d src/blog/$i ]; then
d=$(echo $i | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}')
t=$(head -n 1 src/blog/$i/*.md | sed 's/# //')
+
+ thisyear=$(echo $d | sed 's/-.*//')
+ if [ "$thisyear" != "$lastyear" ]; then
+ printf "\n## $thisyear\n\n" >> $bg
+ lastyear=$thisyear
+ fi
echo "=> $i $d $t" >> $bg
fi
done
diff --git a/src/blog/blog.md b/src/blog/blog.md
@@ -2,6 +2,9 @@
[RSS Feed](feed.xml)
+
+## 2022
+
* 2022-12-24 [The man page reading club: ed(1)](2022-12-24-ed)
* 2022-11-23 [Self-hosted git pages with stagit (featuring ed, the standard editor)](2022-11-23-git-host)
* 2022-10-19 [Keeping my email sorted (the hard way)](2022-10-19-email-setup)