about summary refs log tree commit diff stats
path: root/webblog
blob: a32b260bf7dd3c2d3844cfbb819a34935f2c0705 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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
echo '<h1>Fulton''s blog</h1>'  >>  $o'/'index.html

for(i in $posts){
	name=`{gettitle $i}
	echo '<a href="'$i'.html">'$"name'</a> <br>' >>  $o'/'index.html
}
exit 0