From 4d4867ed7731c7aa70855e0b62913f442d35628c Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 10 Apr 2021 14:37:56 +0000 Subject: finally released to the world. --- mkweb | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 mkweb (limited to 'mkweb') diff --git a/mkweb b/mkweb new file mode 100755 index 0000000..d29cc05 --- /dev/null +++ b/mkweb @@ -0,0 +1,48 @@ +#!/bin/rc +rfork en +filter='^(bin|lib|pic|tpl)' +sections=`{walk -d | grep -v $filter} + +fn entitle { + basename $1 | sed 's/-/ /g' | bin/capitalize +} + +fn usage { + echo usage: $0 [ -m ] [ -s section ] >[1=2] + exit usage +} + +fn buildsection { + if(test -f $1/index.md) + >$1/index.html { + if(! ~ $1 .){ + title=`{entitle $1} + [^<]*)/\1 - '^$"title^'/' + } + if not cat tpl/head + cat tpl/menu \ + <{bin/md2html.awk $1/index.md}\ + tpl/feet + } +} + +if(! ~ $#* 0) + switch($1){ + case -m + >sitemap.txt { + site=http://rgl.antares-labs.eu + echo $site/index.html + for(d in $sections) + echo $site/$d/index.html + } + case -s + if(~ $#2 0) + usage + buildsection $2 + case -* + usage + } +if not + for(d in $sections .){ + buildsection $d + } -- cgit v1.2.3