2003-08-25 18:51:06 UTC
Hi,
I found your program while searching for a kind og blog, which does not need php, mysql or anything like that. So I like your Program and I will use it. I have written some small enhancements, which i called dairy2html:
#!/bin/bash
DIARYDIR="$HOME/.diary"
PAGEDIR="$DIARYDIR/pages"
PICDIR="$DIARYDIR/pictures"
cat $DIARYDIR/html_head.txt > $DIARYDIR/diary.html
for i in `ls -r $PAGEDIR`; do
cat $PAGEDIR/$i | sed -e '1s/\(.*\)/<h2>\1<\/h2>/;2,$s/$/\1<br>/' >> $DI
ARYDIR/diarytmp.html
#insert pictures
for j in 1 2 3 4 5 6 7 8 9 ; do
if [ -f $PICDIR/$i.$j.jpg ] ; then
echo "<img src=\"pictures/$i.1.jpg\" alt=\"picture\">" >
> $DIARYDIR/diarytmp.html
fi
done
done
cat $DIARYDIR/diarytmp.html >> $DIARYDIR/diary.html
rm $DIARYDIR/diarytmp.html
cat $DIARYDIR/html_foot.txt >> $DIARYDIR/diary.html
Feel free to take it inside the repository, with, or without changes ...
Bye
Kim