From 39e43de0ea89943ff60dc40faaffa5c419256593 Mon Sep 17 00:00:00 2001 From: Christos Date: Thu, 2 Jan 2025 18:42:52 +0000 Subject: Added horizontal sidebar script and CSS --- cork-hbar.rc | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 cork-hbar.rc (limited to 'cork-hbar.rc') diff --git a/cork-hbar.rc b/cork-hbar.rc new file mode 100644 index 0000000..e3ca727 --- /dev/null +++ b/cork-hbar.rc @@ -0,0 +1,65 @@ +#!/bin/rc + +path=(. /bin) + +req_p=`{echo -n $REQUEST_URI } + +fn run { + lpaf=home$REQUEST_URI + rpafs='/'; wd='/'; ifs='/'; + arg = `{echo -n $REQUEST_URI} + if (test -d $lpaf) { + lpaf=$lpaf^'i' + } + for (i in $arg) { + wd=$wd^$i + rpafs=($rpafs $wd) + wd=$wd'/' + } +http_content_type='text/html' +echo Content-Type: $http_content_type + echo; + for (h in $bar) { $$h } + mh $lpaf.md +} + + +fn sbar { + echo -n 'insert html preamble' + ls -F home/./$rpafs | sed -e 's,/+\./+,/,g' \ + -e '/\/i\.(md)$/d' \ + -e 's/\.(md)$//' -e 's!^home!!' | sort | awk -F/ ' + function p(x, y, s) { for(i=0; i < x-y; i+=1) printf s } + BEGIN { lNF=2; printf ""); printf "
" }' +} + +fn add { + _l = $1^_^$#$1 + $_l = $*(2-) + $1 = ($$1 $_l) +} + +add bar sbar; run -- cgit v1.2.3