hhvn.uk

Website, gopher, etc
Log | Files | Refs | Submodules

commit d1b1ab0bf550be4b56fd3884dadf2910e3f177da
parent e4f10c5fc6c43b94b66bf4e4aa3e7b2a6dd8a6a9
Author: hhvn <dev@hhvn.uk>
Date:   Sat, 26 Nov 2022 20:19:56 +0000

Phlog generation

Diffstat:
Mgen/generate.rc | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++------
Mgopher/index.gph | 4+---
Dgopher/phlog | 2--
3 files changed, 56 insertions(+), 11 deletions(-)

diff --git a/gen/generate.rc b/gen/generate.rc @@ -43,6 +43,8 @@ webatom = ../www/blog/feed.xml blog = ../www/blog/index.html blogdir = ../www/blog +mkdir -p $blogdir + rm $blogdir/* for (f in $notesdir/*) { cp $f $blogdir/ ^ `$nl{basename $f} @@ -69,7 +71,7 @@ cat > $webatom <<'EOF' <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title>hhvn's blog</title> - <subtitle>Notes and stuff.</subtitle> + <subtitle>Notes and stuff. Also available at gopher://hhvn.uk/1/phlog</subtitle> <link href="http://hhvn.uk/blog/feed.xml" rel="self" /> <link href="gopher://hhvn.uk/phlog/feed.xml" /> <link href="http://hhvn.uk/" /> @@ -89,16 +91,13 @@ fn recent { if (recent $date || {!~ $updated () && recent $updated}) { recent = '<b style="color:#00aa00 !important;">[NEW]</b> ' } else { - recent = ' ' + recent = '[&nbsp;&nbsp;&nbsp;]' } atomentry $f $base $webatom $title http://hhvn.uk/blog printf '[%s] %s<a href="./%s">%s</a><br />\n' \ - $date \ - $recent \ - `$nl{basename $f} \ - `$nl{grep '^Title: ' < $f | sed 's/[^ ]* //'} + $date $recent $base $title }} | sort -r >> $blog cat >> $blog <<'EOF' @@ -108,3 +107,53 @@ EOF cat >> $webatom <<'EOF' </feed> EOF + +# Phlog generation +gphatom = ../gopher/phlog/feed.xml +phlog = ../gopher/phlog/index.gph +phlogdir = ../gopher/phlog + +mkdir -p $phlogdir + +rm $phlogdir/* +for (f in $notesdir/*) { + cp $f $phlogdir/ ^ `$nl{basename $f} +} + +cat > $phlog <<'EOF' +Welcome to hhvn's phlog. + +[0|Atom feed|feed.xml|server|port] + +EOF + +cat > $gphatom <<'EOF' +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <title>hhvn's phlog</title> + <subtitle>(Bank)notes and (food)stuff(s).<subtitle> + <link href="gopher://hhvn.uk/phlog/feed.xml" rel="self" /> + <link href="gopher://hhvn.uk/" /> +EOF + +{for (f in $notesdir/*.txt) { + base = `$nl{basename $f} + title = `$nl{grep '^Title: ' < $f | sed 's/[^ ]* //'} + date = `$nl{grep '^Date: ' < $f | sed 's/[^ ]* //'} + updated = `$nl{grep '^Upated: ' < $f | sed 's/[^ ]* //;s/ .*//'} + + if (recent $date || {!~ $updated () && recent $updated}) { + recent = '[NEW]' + } else { + recent = ' ' + } + + atomentry $f $base $gphatom $title gopher://hhvn.uk/0/phlog + + printf '[0|[%s] %s %s|/phlog/%s|server|port]\n' \ + $date $recent $title $base +}} | sort -r >> $phlog + +cat >> $gphatom <<'EOF' +</feed> +EOF diff --git a/gopher/index.gph b/gopher/index.gph @@ -6,9 +6,7 @@ IRC: hhvn at #hlircnet on irc.hlirc.net [I|Where's the old one? uhhhhh, here somewhere|eight-small-disks.jpg|server|port] [1|How about some code instead?|git/|server|port] - -Phlog: -[0|2022-11-22 Tips for workflows involving makefiles and gdb|/plog/makefile_workflow.txt|server|port] +[1|Or my phlog, pershmaps?|phlog/|server|port] [0|PGP key|/pgp.asc|server|port] [0|SSH key|/ssh.pub|server|port] diff --git a/gopher/phlog b/gopher/phlog @@ -1 +0,0 @@ -../notes/ -\ No newline at end of file