aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2022-12-29 23:18:51 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2022-12-29 23:18:51 +0100
commit57f783cdfbdfbfd3dfa30da9adb7bba88da0ecd5 (patch)
tree840c38371ed5a1e3aed03056aab95dca628028e9
parentccc471008c6897d22d0fe318e214c21f9a971656 (diff)
downloadsebastiano.tronto.net-57f783cdfbdfbfd3dfa30da9adb7bba88da0ecd5.tar.gz
sebastiano.tronto.net-57f783cdfbdfbfd3dfa30da9adb7bba88da0ecd5.zip
Added year to blog index
-rwxr-xr-xbuild.sh13
-rw-r--r--src/blog/blog.md3
2 files changed, 16 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 7cb3ff1..6e8e74e 100755
--- a/build.sh
+++ b/build.sh
@@ -61,6 +61,13 @@ makeblog() {
61 f="src/blog/$i/*.md" 61 f="src/blog/$i/*.md"
62 d=$(echo $i | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}') 62 d=$(echo $i | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}')
63 t=$(head -n 1 $f | sed 's/# //') 63 t=$(head -n 1 $f | sed 's/# //')
64
65 thisyear=$(echo $d | sed 's/-.*//')
66 if [ "$thisyear" != "$lastyear" ]; then
67 printf "\n## $thisyear\n\n" >> $bf
68 lastyear=$thisyear
69 fi
70
64 echo "* $d [$t]($i)" >> $bf 71 echo "* $d [$t]($i)" >> $bf
65 72
66 echo "<item>" >> $ff 73 echo "<item>" >> $ff
@@ -86,6 +93,12 @@ gemblog() {
86 if [ -d src/blog/$i ]; then 93 if [ -d src/blog/$i ]; then
87 d=$(echo $i | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}') 94 d=$(echo $i | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}')
88 t=$(head -n 1 src/blog/$i/*.md | sed 's/# //') 95 t=$(head -n 1 src/blog/$i/*.md | sed 's/# //')
96
97 thisyear=$(echo $d | sed 's/-.*//')
98 if [ "$thisyear" != "$lastyear" ]; then
99 printf "\n## $thisyear\n\n" >> $bg
100 lastyear=$thisyear
101 fi
89 echo "=> $i $d $t" >> $bg 102 echo "=> $i $d $t" >> $bg
90 fi 103 fi
91 done 104 done
diff --git a/src/blog/blog.md b/src/blog/blog.md
index 514492d..7498534 100644
--- a/src/blog/blog.md
+++ b/src/blog/blog.md
@@ -2,6 +2,9 @@
2 2
3[RSS Feed](feed.xml) 3[RSS Feed](feed.xml)
4 4
5
6## 2022
7
5* 2022-12-24 [The man page reading club: ed(1)](2022-12-24-ed) 8* 2022-12-24 [The man page reading club: ed(1)](2022-12-24-ed)
6* 2022-11-23 [Self-hosted git pages with stagit (featuring ed, the standard editor)](2022-11-23-git-host) 9* 2022-11-23 [Self-hosted git pages with stagit (featuring ed, the standard editor)](2022-11-23-git-host)
7* 2022-10-19 [Keeping my email sorted (the hard way)](2022-10-19-email-setup) 10* 2022-10-19 [Keeping my email sorted (the hard way)](2022-10-19-email-setup)

Generated with cgit - Back to sebastiano.tronto.net