aboutsummaryrefslogtreecommitdiff
path: root/build.sh
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 /build.sh
parentccc471008c6897d22d0fe318e214c21f9a971656 (diff)
downloadsebastiano.tronto.net-57f783cdfbdfbfd3dfa30da9adb7bba88da0ecd5.tar.gz
sebastiano.tronto.net-57f783cdfbdfbfd3dfa30da9adb7bba88da0ecd5.zip
Added year to blog index
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh13
1 files changed, 13 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

Generated with cgit - Back to sebastiano.tronto.net