I decided it was no longer acceptable to be listing both Black-tailed Godwit and Black tailed godwit as separate species, let alone the various permutations of Great(er) black(-)backed gull. So now my life and year lists are checked and corrected! There are additional benefits…

I added a new data file, based on the British List from the BOU with a couple of tweaks.

I also added a list of synonyms, which are my misspellings and what they should be corrected to. This allows the additional feature of being able to use nicknames such as “blackwit” or “dabchick” and have them expanded. It looks like this:

# Waders
bar tailed godwit: Bar-tailed Godwit
barwit: Bar-tailed Godwit
black tailed godwit: Black-tailed Godwit
blackwit: Black-tailed Godwit
common Snipe: Snipe

# Gulls
great black backed gull: Great Black-backed Gull
greater black backed gull: Great Black-backed Gull
greater black-backed gull: Great Black-backed Gull
gbb: Great Black-backed Gull

The logic employed in the generator is as follows:

  • When iterating through the posts, look at each bird name.
  • If the bird name is in reference.yml, that’s good. Else
    • if the bird name is in my synonyms.yml, make the change,
    • otherwise, add the name to a list of errors that will end up on my private housekeeping page.
  • write all the bird names to a new variable on the post (uncorrected errors will remain).
  • the post will generate its list of birds at the bottom from the new variable, so birds on the synonym list will be corrected, but other mistakes will be preserved.
  • on my secret housekeeping page, a list of errors is presented. These can be addressed by:
    • amending the original post (eg. for a one-off typo)
    • adding a synonym (for a frequent error or alternate name)
    • amending what is now my personal British List (it’s my blog, I can have White Wagtail as a separate species if I want).
  • on the year list and life list pages ( I should expand this to location lists! ) and now location pages, the list generation process is now:
    • iterate through the British List
    • if the bird is present in the year/life list for that page, write it to the list.
    • this puts the list into the correct order (rather than alphabetic) and preserves ‘correct’ capitalisation.

List generation on all pages except posts is now handled by a single include; by passing a liquid parameter I can choose an inline list rather than the default numbered list. Commas are handled by CSS, and it would be too much work to remove the Oxford comma so we’re stuck with it.

Posts remain different because of the need to include life ticks and such. That means that they are now the only alphabetical lists. I don’t think this is a problem?

Addendum

Never mind; it turned out to be relatively easy to use the same include to format the bird list on posts as well. Now the sort order and capitalisation of all bird lists is determined by reference.yml and birds that aren’t on that (misspellings etc) won’t show up anywhere except the housekeeping page.