about summary refs log tree commit diff stats
path: root/webblog
diff options
context:
space:
mode:
authorFulton Browne <git@fulton.software>2021-05-28 03:51:46 +0000
committerFulton Browne <git@fulton.software>2021-05-28 03:51:46 +0000
commit598addf2fe5994c8c237a853a206004163da99f0 (patch)
treeab9fdbd5c5d6bb8b96916ba7efddb97bbbcfcc2a /webblog
parent6ad3da3f46c45620da55bee9dc659f6888181572 (diff)
downloadg9srv-598addf2fe5994c8c237a853a206004163da99f0.tar.gz
added webblog
Diffstat (limited to 'webblog')
-rwxr-xr-xwebblog35
1 files changed, 35 insertions, 0 deletions
diff --git a/webblog b/webblog
new file mode 100755
index 0000000..ff67fa1
--- /dev/null
+++ b/webblog
@@ -0,0 +1,35 @@
+#!/bin/rc
+webroot = ./
+o=./
+fn gettitle{
+	echo `{echo $1 | sed 's/\+/ /g'}
+}
+while(! ~ $#* 0) {
+	switch ($1) {
+	case -w
+		webroot=$2
+		shift
+	case -o
+		o=$2
+		shift
+	case *
+		echo Usage: g9srv/webblog [-w webroot] [-o output dir]
+		exit usage
+	}
+	shift
+}
+
+posts=`{ls -pr $webroot/posts}
+
+for(i in $posts){
+	awk -f /lib/gemtohtm < $webroot'/posts/'$i'' > $o'/'$i.html
+}
+
+
+echo '<link rel="stylesheet" href="/style.css">'  >  $o'/'index.html
+echo '<title>fulton.software blog</title>'  >>  $o'/'index.html
+for(i in $posts){
+	name=`{gettitle $i}
+	echo '<a href="'$i'.html">'$"name'</a> <br>' >>  $o'/'index.html
+}
+exit 0