1
0
Fork 0
Browse Source

Output information added

master
Rogier Neeleman 10 years ago
parent
commit
012e53cbb4
  1. 21
      genereer

21
genereer

@ -11,6 +11,7 @@ SERVERS='314.sciuro.org chip.sciuro.org skippy.sciuro.org slappy.sciuro.org irc.
mkdir -p $SITE mkdir -p $SITE
# Root pagina's # Root pagina's
echo -n "Generating root pages"
rm -rf $SITE/*.html rm -rf $SITE/*.html
for i in `ls *.txt`; do for i in `ls *.txt`; do
FILENAME=`echo $i |cut -d\. -f1` FILENAME=`echo $i |cut -d\. -f1`
@ -18,8 +19,10 @@ for i in `ls *.txt`; do
cat $i >> $SITE/$FILENAME.html cat $i >> $SITE/$FILENAME.html
cat $LAYOUT/footer.html >> $SITE/$FILENAME.html cat $LAYOUT/footer.html >> $SITE/$FILENAME.html
done done
echo " [Ok]"
# Server directory # Server directory
echo -n "Generating server pages"
mkdir -p $SITE/servers/ mkdir -p $SITE/servers/
rm -rf $SITE/servers/*.html rm -rf $SITE/servers/*.html
@ -46,8 +49,10 @@ for i in $SERVERS; do
echo "</center>" >> $SITE/$FILENAME.html echo "</center>" >> $SITE/$FILENAME.html
cat $LAYOUT/footer.html >> $SITE/$FILENAME.html cat $LAYOUT/footer.html >> $SITE/$FILENAME.html
done done
echo " [Ok]"
# Howto directory # Howto directory
echo -n "Generating howto pages"
mkdir -p $SITE/howto/ mkdir -p $SITE/howto/
rm -rf $SITE/howto/*.html rm -rf $SITE/howto/*.html
@ -74,8 +79,10 @@ for i in `ls howto/*.txt`; do
echo "Last modification: $MODTIME" >> $SITE/$FILENAME.html echo "Last modification: $MODTIME" >> $SITE/$FILENAME.html
cat $LAYOUT/footer.html >> $SITE/$FILENAME.html cat $LAYOUT/footer.html >> $SITE/$FILENAME.html
done done
echo " [Ok]"
# Blog pages # Blog pages
echo -n "Generating blog pages"
mkdir -p $SITE/blog/ mkdir -p $SITE/blog/
rm -rf $SITE/blog/*.html rm -rf $SITE/blog/*.html
@ -108,8 +115,10 @@ for i in `ls blog/*.txt`; do
echo "<a href='mailto:react@sciuro.org?SUBJECT=$BLOGID'>React to blog</a>" >> $SITE/$FILENAME.html echo "<a href='mailto:react@sciuro.org?SUBJECT=$BLOGID'>React to blog</a>" >> $SITE/$FILENAME.html
cat $LAYOUT/footer.html >> $SITE/$FILENAME.html cat $LAYOUT/footer.html >> $SITE/$FILENAME.html
done done
echo " [Ok]"
# Photo pages # Photo pages
echo -n "Generating Photo pages"
mkdir -p $SITE/photo/ mkdir -p $SITE/photo/
rm -rf $SITE/photo/*.html rm -rf $SITE/photo/*.html
@ -128,6 +137,7 @@ for i in `ls -r photo/*.txt`; do
echo "-<a href='__SITEURL__/$FILENAME.html'>$PTITLE</a>" >> $SITE/photo/index.html echo "-<a href='__SITEURL__/$FILENAME.html'>$PTITLE</a>" >> $SITE/photo/index.html
done done
cat $LAYOUT/footer.html >> $SITE/photo/index.html cat $LAYOUT/footer.html >> $SITE/photo/index.html
echo " [Ok]"
for i in `ls photo/*.txt`; do for i in `ls photo/*.txt`; do
FILENAME=`echo $i |cut -d\. -f1` FILENAME=`echo $i |cut -d\. -f1`
@ -135,6 +145,7 @@ for i in `ls photo/*.txt`; do
BDATE=`date -d$BFILEDATE +%A\ %B\ %e\ %Y` BDATE=`date -d$BFILEDATE +%A\ %B\ %e\ %Y`
BLOGID=`echo $FILENAME |cut -d\/ -f2` BLOGID=`echo $FILENAME |cut -d\/ -f2`
DIRNAME=`echo $FILENAME |cut -d\/ -f2` DIRNAME=`echo $FILENAME |cut -d\/ -f2`
echo -n "Processing photo album $DIRNAME "
mkdir -p $SITE/$FILENAME/normal/ mkdir -p $SITE/$FILENAME/normal/
mkdir -p $SITE/$FILENAME/thumbs/ mkdir -p $SITE/$FILENAME/thumbs/
@ -186,24 +197,34 @@ for i in `ls photo/*.txt`; do
echo "<center><img src='__SITEURL__/photo/$DIRNAME/normal/$IMAGENAME' width=480px></center>" >> $SITE/photo/$DIRNAME/$NAME.html echo "<center><img src='__SITEURL__/photo/$DIRNAME/normal/$IMAGENAME' width=480px></center>" >> $SITE/photo/$DIRNAME/$NAME.html
cat $LAYOUT/footer.html >> $SITE/photo/$DIRNAME/$NAME.html cat $LAYOUT/footer.html >> $SITE/photo/$DIRNAME/$NAME.html
echo -n "*"
done done
echo "</table></center>" >> $SITE/$FILENAME.html echo "</table></center>" >> $SITE/$FILENAME.html
cat $LAYOUT/footer.html >> $SITE/$FILENAME.html cat $LAYOUT/footer.html >> $SITE/$FILENAME.html
echo " [Ok]"
done done
# Other directories # Other directories
echo -n "Process extra directories"
for i in $EXTRA; do for i in $EXTRA; do
rm -rf $SITE/$i rm -rf $SITE/$i
cp -a $i $SITE/$i cp -a $i $SITE/$i
done done
echo " [Ok]"
# Replace variables # Replace variables
echo -n "Replace variables"
for i in `find $SITE/ -name *.html`; do for i in `find $SITE/ -name *.html`; do
sed -i 's/__SITEURL__/\/newsite/g' $i sed -i 's/__SITEURL__/\/newsite/g' $i
done done
echo " [Ok]"
# Publish # Publish
echo -n "Publish website"
rsync --delete --recursive $SITE/* 314:/usr/share/mini-httpd/html/newsite/ rsync --delete --recursive $SITE/* 314:/usr/share/mini-httpd/html/newsite/
echo " [Ok]"

Loading…
Cancel
Save