Limite the length of descs and factor into sep function
This commit is contained in:
parent
427a69a938
commit
5cb61ee64c
1 changed files with 7 additions and 3 deletions
|
|
@ -7,6 +7,10 @@ cpath = ''
|
||||||
rpath = `{pwd}
|
rpath = `{pwd}
|
||||||
rpath = $rpath^'/'^$sitedir
|
rpath = $rpath^'/'^$sitedir
|
||||||
|
|
||||||
|
fn getMdDesc {
|
||||||
|
sed 's/^(.......................................................................................................[^ ]*).*$/\1/g; 1q' < $1
|
||||||
|
}
|
||||||
|
|
||||||
fn listDir {
|
fn listDir {
|
||||||
cd $1
|
cd $1
|
||||||
dirfilter = $saveddf
|
dirfilter = $saveddf
|
||||||
|
|
@ -14,17 +18,17 @@ fn listDir {
|
||||||
. _config
|
. _config
|
||||||
|
|
||||||
echo '<ul>'
|
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,//*,/,;' }
|
cpath = `{ pwd | sed 's,^'^$"rpath/?^',,; s,//*,/,;' }
|
||||||
if( ~ $#cpath 0 )
|
if( ~ $#cpath 0 )
|
||||||
cpath = ''
|
cpath = ''
|
||||||
|
|
||||||
desc = ''
|
desc = ''
|
||||||
if (test -f $i.md) {
|
if (test -f $i.md) {
|
||||||
desc = `{ sed 1q < $i.md }
|
desc = `{ getMdDesc $i.md }
|
||||||
}
|
}
|
||||||
if (test -f $i/index.md) {
|
if (test -f $i/index.md) {
|
||||||
desc = `{ sed 1q < $i/index.md }
|
desc = `{ getMdDesc $i/index.md }
|
||||||
}
|
}
|
||||||
if (test -f $i.html) {
|
if (test -f $i.html) {
|
||||||
# H1 is not reliable because htmlroff doesn't use it :(
|
# H1 is not reliable because htmlroff doesn't use it :(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue