Turning Omeka Classic into a Static Site

More than a decade ago now, I started an Omeka Classic website to host a small collection of primary sources related to my research. But several years have passed since I was actively updating it, and in the meantime, my sysadmin started nudging me to address various errors it was throwing on my server. So yesterday I spent a few hours converting my Omeka collection into a static site.

The result: what used to look like this now looks like this.

A dynamic website engine like Omeka was probably always more complex and high-maintenance than what I needed for this small digital garden. And I will shed no tears over moving away from mySQL and PHP. But I did want to maintain the metadata and the permalinks for the sources and few collections I had planted there.

I link extensively to some of the items I was keeping in Omeka in my open research notebook. The site also included some key sources for my latest book: namely, the newspaper articles containing two interviews with Henrietta Wood. Plus, I occasionally hear from genealogists who are doing research on their families, including ancestors who may have been enslaved, and they are glad to find some of these primary sources. Just this week, someone left a comment on my notebook about John C. Moore, some of whose correspondence is in a Weeks Family collection I was keeping in Omeka. I wanted these resources to continue living on the open web, with the stable URLs where people expect to find them, but without having to wrangle databases and Omeka upgrades.

My solution was a little bit eccentric and maybe more difficult than it needed to be. I used wget to download all of the “item” pages from Omeka. I used pandoc and vim to convert the static html I downloaded into Markdown and clean up lint and eliminate formatting. I also used vim to change URLs in links that needed changing. Then I used 11ty (a highly customizable static site generator) to serve those Markdown files as a static site, with permalinks that would still be the same as they were on the old Omeka install. Because Omeka had placed all image and PDF files into a static directory on my server, the absolute URLs to all those files still work the same.

The most tedious part was probably updating the YAML metadata for 11ty and reproducing the functionality of Omeka’s “collections.” Basically, I tagged all the items in each collection using the 11ty metadata block, so that I could then generate a static index page of each collection with links to the items it contained.

Maybe one of these days I’ll work on making the styling a little nicer. And my method probably was helped by the fact that I didn’t have a huge Omeka database, maybe 170 items in all. But for less than a day’s work, I’m pretty happy with how it turned out.


📨 Reply by email

W. Caleb McDaniel @wcaleb
© 2024 by W. Caleb McDaniel

Archive