site

bvnf.space sources
Log | Files | Refs

commit e450dba3e586583a8ee5efa2286bfe9f1226a22a
parent 684d3692c665ce595a3d05ace90b90319b0c4d97
Author: aabacchus <ben@bvnf.space>
Date:   Fri, 26 Nov 2021 10:31:47 +0000

blog: add gemini links

ick

Diffstat:
Ablog/002-001_setting_up_vger.gmi | 2++
Ablog/003-002_custom_404s.gmi | 2++
Ablog/004-003_c_complexity.gmi | 2++
Ablog/005-004_counting_with_unix.gmi | 2++
Mblog/gen-index.sh | 24++++++++++++++++++------
5 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/blog/002-001_setting_up_vger.gmi b/blog/002-001_setting_up_vger.gmi @@ -0,0 +1,2 @@ +Setting up vger(8) on OpenBSD +October 27, 2021 diff --git a/blog/003-002_custom_404s.gmi b/blog/003-002_custom_404s.gmi @@ -0,0 +1,2 @@ +I hate custom 404s +August 29, 2021 diff --git a/blog/004-003_c_complexity.gmi b/blog/004-003_c_complexity.gmi @@ -0,0 +1,2 @@ +C code complexity +November 17, 2021 diff --git a/blog/005-004_counting_with_unix.gmi b/blog/005-004_counting_with_unix.gmi @@ -0,0 +1,2 @@ +Server statistics with UNIX +November 19, 2021 diff --git a/blog/gen-index.sh b/blog/gen-index.sh @@ -24,16 +24,28 @@ cat << EOF <table> EOF -for txt in *.txt ; do - in="${txt%.txt}.7" - date="$(grep '^[.]Dd' "$in" | cut -c 5-)" - title="$(grep '^[.]Nm' "$in" | cut -c 5-)" - desc="$(grep '^[.]Nd' "$in" | cut -c 5-)" +for f in $(ls -r *.txt *.gmi) ; do + unset date title desc link in + case "$f" in + *.txt) + link="$f" + in="${f%.txt}.7" + date="$(grep '^[.]Dd' "$in" | cut -c 5-)" + title="$(grep '^[.]Nm' "$in" | cut -c 5-)" + desc=" - $(grep '^[.]Nd' "$in" | cut -c 5-)" + ;; + *.gmi) + link="gemini://gemini.bvnf.space/blog/${f#[0-9][0-9][0-9]-}" + title="$(sed 1q "$f")" + date="$(sed 1d "$f")" + ;; + esac + cat <<EOF <tr> <td align="left" class="index-post"> - <a href="$txt">$title</a> - $desc + <a href="$link">$title</a>$desc </td> <td align="right" class="index-date">$date</td> </tr>