{ config, lib, ... }:
{
  pages.events = { link, ... }: rec {
    title = "Events";
    description = "Events related to the Fediverse and NixOS";
    summary = description;
    body =
      with lib;
      let
        events = map
          (event: with lib; ''
            ## [${event.title}](${link event})

            ${event.start-date} ${optionalString (!isNull event.end-date && event.end-date != event.start-date) "to ${event.end-date}"} in ${event.location}
          '')
          config.collections.events.entry;
      in
      ''
        ${join "\n" events}
      '';
  };
}
