swerc

anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

commit 99278f2ce59676e529b4740996e350cb73fa8710
parent 29c2c5e62798de73e1783feca74974e1961d55b4
Author: uriel@engel.se.cat-v.org <unknown>
Date:   Sat,  9 Jun 2007 23:36:37 +0200

New embeded handling of .html files

Remove old sh gensitemap

Allow 'Blog' as well as 'blog'
Diffstat:
Mbin/controller.rc | 10+++++++---
Dbin/gensitemaptxt.sh | 5-----
2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/bin/controller.rc b/bin/controller.rc @@ -21,10 +21,10 @@ for(i in siteTitle siteSubTitle title extraHeaders) # Title fn gentitle { - echo '<h1 class="headerTitle"><a href="/">' ^ $"siteTitle ^ '<span id="headerSubTitle">' ^ $"siteSubTitle ^ '</span></a></h1>' + echo '<h1 class="headerTitle"><a href="/">' ^ $"siteTitle ^ ' <span id="headerSubTitle">' ^ $"siteSubTitle ^ '</span></a></h1>' } -dirfilter = '/\/[._]/d; s,^\./,,; s,\.md$,,;' +dirfilter = '/\/[._]/d; s,^\./,,; s,\.md$,,; s,\.html,,;' # Sidebar fn menu { @@ -77,7 +77,11 @@ fn genbody { markdown.pl < $body.md if not if ( test -f $body.tpl ) template.awk $body.tpl | rc $rcargs - if not if ( ~ $body */blog/index */blog//index && ~ $#blogDirs 0 ) + if not if ( test -f $body.html ) + cat $body.html | /bin/sed '0,/<body>/d; /<\/body>/,$d' + if not if (~ $body *.html && test -f $body ) + sed '0,/<body>/d;/<\/body>/,$d' < $body + if not if ( ~ $body */[bB]log/index */[bB]log//index && ~ $#blogDirs 0 ) blogDirs = `{basename -d $body} if not if(~ $body */index && ~ $#blogDirs 0) { echo '<h1>' `{basename `{basename -d $body}}'</h1>' diff --git a/bin/gensitemaptxt.sh b/bin/gensitemaptxt.sh @@ -1,5 +0,0 @@ -#!/bin/sh -for d in sites/*/; do - find $d -name '*.md'|sed -e 's/\.md$//' -e 's,/index$,/,' -e 's,^sites/,http://,' > $d/sitemap.txt -done -