#!/bin/bash # Variables SITEURL="/newsite" LAYOUT=_layout SITE=site EXTRA='images scripts files' SERVERS='314.sciuro.org chip.sciuro.org skippy.sciuro.org slappy.sciuro.org irc.sciuro.org lists.laurentiusgroep.nl' # Prereq mkdir -p $SITE # Root pagina's echo -n "Generating root pages" rm -rf $SITE/*.html for i in `ls *.txt`; do FILENAME=`echo $i |cut -d\. -f1` cat $LAYOUT/header.html >> $SITE/$FILENAME.html cat $i >> $SITE/$FILENAME.html cat $LAYOUT/footer.html >> $SITE/$FILENAME.html done echo " [Ok]" # Server directory echo -n "Generating server pages" mkdir -p $SITE/servers/ rm -rf $SITE/servers/*.html for i in `ls servers/*.txt`; do FILENAME=`echo $i |cut -d\. -f1` cat $LAYOUT/header.html >> $SITE/$FILENAME.html cat $LAYOUT/servers.html >> $SITE/$FILENAME.html cat $i >> $SITE/$FILENAME.html cat $LAYOUT/footer.html >> $SITE/$FILENAME.html done for i in $SERVERS; do HNAME=`echo $i | cut -d\. -f1` DNAME=`echo $i | cut -d\. -f2,3 --output-delimiter=\.` FILENAME=servers/graph-$HNAME cat $LAYOUT/header.html >> $SITE/$FILENAME.html cat $LAYOUT/servers.html >> $SITE/$FILENAME.html cat servers/graph.txt >> $SITE/$FILENAME.html echo "" >> $SITE/$FILENAME.html echo "
" >> $SITE/$FILENAME.html T=$((T+1)) elif [ $T == '5' ]; then echo " | |
" >> $SITE/$FILENAME.html T=1 else echo " | " >> $SITE/$FILENAME.html
T=$((T+1))
fi
IMAGENAME=`echo $j |cut -d\/ -f3`
if [ ! -f $SITE/photo/$DIRNAME/thumbs/$IMAGENAME ]; then
convert -resize 120 photo/$DIRNAME/$IMAGENAME $SITE/photo/$DIRNAME/thumbs/$IMAGENAME
fi
if [ ! -f $SITE/photo/$DIRNAME/normal/$IMAGENAME ]; then
convert -resize 600 photo/$DIRNAME/$IMAGENAME $SITE/photo/$DIRNAME/normal/$IMAGENAME
fi
NAME=`echo $IMAGENAME |cut -d\. -f1`
echo "" >> $SITE/$FILENAME.html
# Picture page
cat $LAYOUT/header.html >> $SITE/photo/$DIRNAME/$NAME.html
echo $BDATE >> $SITE/photo/$DIRNAME/$NAME.html
echo "" >> $SITE/photo/$DIRNAME/$NAME.html
cat $i >> $SITE/photo/$DIRNAME/$NAME.html
echo "" >> $SITE/photo/$DIRNAME/$NAME.html
echo " |