swerc

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

commit b8193092faedd61110c4c08f54428a317544aac0
parent fc32781850c5e1e63be4d0560fd1c46d745bc044
Author: uriel@engel.se.cat-v.org <unknown>
Date:   Sun, 24 Jun 2007 01:21:17 +0200

Limite the length of descs and factor into sep function
Diffstat:
Mpub/sitemap.tpl | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/pub/sitemap.tpl b/pub/sitemap.tpl @@ -7,6 +7,10 @@ cpath = '' rpath = `{pwd} rpath = $rpath^'/'^$sitedir +fn getMdDesc { + sed 's/^(.......................................................................................................[^ ]*).*$/\1/g; 1q' < $1 +} + fn listDir { cd $1 dirfilter = $saveddf @@ -14,17 +18,17 @@ fn listDir { . _config echo '<ul>' - for ( i in `{ls -d */ *.md *.html >[2] /dev/null |sed $dirfilter^'/index$/d;' } ) { + for ( i in `{ ls -d */ *.md *.html >[2]/dev/null |sed $dirfilter^'/index$/d;' } ) { cpath = `{ pwd | sed 's,^'^$"rpath/?^',,; s,//*,/,;' } if( ~ $#cpath 0 ) cpath = '' desc = '' if (test -f $i.md) { - desc = `{ sed 1q < $i.md } + desc = `{ getMdDesc $i.md } } if (test -f $i/index.md) { - desc = `{ sed 1q < $i/index.md } + desc = `{ getMdDesc $i/index.md } } if (test -f $i.html) { # H1 is not reliable because htmlroff doesn't use it :(