#!/bin/csh -f

source labels

./convertem

set image_dir = ${name}_small

if (! -e dates) ./datem

set images = `cat dates | sort -k 2 | awk '{print $1}'`

cat header | sed "s/TITLE/$title/g" > index.html

set n=1
foreach image ($images)
  echo "$image<br>" >> index.html
  echo "<img src='$image_dir/$image' alt='$name $n' ><br><br>" >> index.html
  @ n ++
end

echo ' ' >> index.html
cat trailer >> index.html
