Limite the length of descs and factor into sep function

This commit is contained in:
Uriel 2007-06-24 01:21:17 +02:00
parent 427a69a938
commit 5cb61ee64c

View file

@ -7,6 +7,10 @@ cpath = ''
rpath = `{pwd}
rpath = $rpath^'/'^$sitedir
fn getMdDesc {
sed 's/^(.......................................................................................................[^ ]*).*$/\1/g; 1q' < $1
}
fn listDir {
cd $1
dirfilter = $saveddf
@ -21,10 +25,10 @@ fn listDir {
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 :(