Skip to content

[BUG] event_map shortcode hard-fails the Hugo build when coordinates is blank #16152

Description

@mattstratton

themes/devopsdays-theme/layouts/shortcodes/event_map.html reads coordinates before it checks whether there is anything to render:

{{- $e := partial "functions/get-event-data" . -}}
{{- $coords := split $e.coordinates "," -}}
{{- $lat := index $coords 0 -}}
{{- $lng := index $coords 1 -}}

{{- with $e.location_address -}}
<iframe ...

Two problems:

  1. $lat and $lng are never used. The iframe is built from location_address. The three lines that compute them are dead.
  2. They break the build when coordinates is blank. split on a nil value errors, and it happens outside the with guard, so it runs even for events that have no address at all.

This is a live trap rather than a theoretical one: utilities/docs/cancel-event.md instructs organizers to blank coordinates when cancelling an event. If that event's location.md still contains {{< event_map >}}, the whole site build fails.

coordinates is marked DEPRECATED in reference.md and nothing else consumes it.

Suggested fix: delete the three $coords/$lat/$lng lines.

Found while documenting the repo for AI coding assistants.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions