Generating a Genealogy Website

· Read in about 3 min · (528 words) ·

In this post, I’ll talk about the technical details of how I am generating this website. I am a software engineer by trade, so of course I’ve come up with the geekiest way possible to build this site. If you aren’t interested in the geeky details, read no further! Instead, why not go explore some of the families I have been researching?

I’ve been wanting to build this site for some time, but I don’t usually develop websites, and most of the work I have done has been with Wordpress. While Wordpress can be useful for putting together a complex blog or e-commerce site quickly, it doesn’t lend itself to a site like this without a lot of development work. I like development work, but I didn’t really feel like doing all this in PHP; I wanted to learn something new.

Recently, I discovered Hugo, a static website generator. With Hugo, the website is built before it is uploaded to the web server instead of as each page is requested, as happens with Wordpress. This makes for a fast site with fewer security issues. Of course, it makes is difficult to support user accounts and comments etc, but that is not an issue with this site.

I use Reunion to maintain my research database. So the obvious question is how to get the data from Reunion into the website. Getting the data out of Reunion is easy; just about any genealogy software has the ability to export its data as a GEDCOM file, a standard file format for representing genealogical information.

This is where the fun starts! I needed a way to get the data from the GEDCOM file to something Hugo could read. I wrote a program to do this: gedcom2hugo. The gedcom2hugo program takes a GEDCOM file and generates .md files for each person and source in the GEDCOM file. Each of these files becomes a web page when it is processed by Hugo. Like this website, gedcom2hugo is a work in progress, and will be evolving along with the site. For example, I’ll eventually expand it to generate pages for each family, and to include photographs.

Gedcom2hugo is written in Go. Why? Because I try to learn a new programming language every year, and Go is my current project. Gedcom2hugo is primarily concerned with generating those important .md files that Hugo wants to see. It relies on the gedcom library to read and parse the GEDCOM file. This library was originally written by Ian Davis, but I have extended it to meet my needs for this project. In particular, Reunion does some non-standard things with the GEDCOM “standard”, so there needed to be some changes to the library to support it.

So as I continue in my family research, my overall workflow looks like this:

  • Update Reunion.
  • Export a GEDCOM file from Reunion, making sure to exclude most information about living family members for privacy reasons.
  • Build the .md files using gedcom2hugo.
  • Build the website using Hugo.
  • Copy the new website to the server.

It’s been a lot of work to set this up, but it makes the process of updating the site relatively painless.