ref: a2cdff91c941cebc075bd5b4421c6634ee15d247
parent: bf0e251a82566f044f228771981a301797e807af
author: Moody <[email protected]>
date: Fri Aug 21 19:57:31 EDT 2020
Add option to display folders as pages of links
--- /dev/null
+++ b/handlers/dir-index
@@ -1,0 +1,8 @@
+#!/bin/rc
+full_path=`{echo $"fs_root^$"location | urlencode -d}
+full_path=$"full_path
+
+echo '20 text/gemini'^$cr
+ls $full_path | sed '
+ s,^'$fs_root'/,,g
+ s,^,=> /,g'
--- /dev/null
+++ b/handlers/static-or-index
@@ -1,0 +1,10 @@
+#!/bin/rc
+full_path=`{echo $"fs_root^$"location | urlencode -d}
+full_path=$"full_path
+if(~ $"location */)
+ exec dir-index
+if(test -d $full_path){
+ location=$location^'/'
+ exec dir-index
+}
+exec serve-static