HTML, perl

Generating a School Yearbook or Staff Directory Web Page

We were recently contracted to build a simple yearbook web page for an educational institution. The website was to be in the usual yearbook format of a grid of photos, with the name of the student above the photo, and some brief details of the student below each photo.

The yearbook needed to be responsive so it would work on phones, tablets, and desktops, so we chose Twitter Bootstrap as it was the responsive framework we have the most expertise with, and our clients have been most happy with the results of Twitter Bootstrap over the years.

Because there were so many students it would be impractical and tedious to hand build a web page with hundreds of photos, and the educational institution had already collected all headshot photos and text files containing the details of each student. So we decided to build a small perl script that would generate the yearbook web page from the files the institution had collected.

Each student had a directory on a shared drive, and the each student’s folder contained a headshot photo and a text file containing the details. The perl script read each directory in turn, resized the photo into a web friendly size, copied the photo into the output directory, and pushed the student’s info into a data structure, which a Template::Toolkit template then turned into a HTML page formatted with Bootstrap.