ref: d6991c5939fbdb5529a1e393e134595e673c5bc7
parent: cac95f38711f382d0a56c8ff87c6302636dac338
author: Jacob Moody <moody@posixcafe.org>
date: Sun Apr 2 15:02:52 EDT 2023
add usr pages
--- a/list
+++ b/list
@@ -23,7 +23,7 @@
if(! ~ $udir $ndir)
echo '</dl>'
if(! ~ $udir $ndir){
- echo '<h3><a name="'$ndir'">'$ndir'</a></h3>'
+ echo '<h3><a href="/'$ndir'/usr.html" name="'$ndir'">'$ndir'</a></h3>'
echo '<dl>'
udir=$ndir
}
--- a/mkfile
+++ b/mkfile
@@ -11,7 +11,8 @@
log\
show\
patch\
- feed
+ feed\
+ usr
LIBFILES=\
common.rc\
--- /dev/null
+++ b/usr
@@ -1,0 +1,41 @@
+#!/bin/rc -e
+
+. /sys/lib/shithub/common.rc
+
+cd $1
+shift
+
+usr=$1
+shift
+
+rfork ne
+nl='
+'
+
+prelude '' 'the fragrant git host'
+echo '<img src="/static/'$logo'" /><br/>'
+
+echo '<h2>'^$usr^'</h2>'
+if(test -f $usr/desc.html)
+ cat $usr/desc.html
+if not if(test -f $usr/desc){
+ echo '<pre>'
+ htcat $usr/desc
+ echo '</pre>'
+}
+
+udir=()
+for(repo in `$nl{ls $usr/}){
+ name=`{basename $repo}
+ if(test -e $repo/.git/webpublish){
+ echo '<dt><a href="/'$repo'/HEAD/info.html">'$name'</a></dt>'
+ echo '<dd>'
+ if(test -f $repo/.git/desc)
+ htcat $repo/.git/desc
+ if not if(test -f $repo/.git/description)
+ htcat $repo/.git/description
+ if not
+ echo 'probably some code'
+ echo '</dd>'
+ }
+}