#!/bin/csh -x

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' width="100%" height="auto"><br><br>" >> index.html
  @ n ++
end

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