fix: handle venues w/out lat/long

This commit is contained in:
Cory Dransfeldt 2024-08-02 20:17:45 -07:00
parent 5fa46fa619
commit cc4fd8b7ed
No known key found for this signature in database
3 changed files with 13 additions and 4 deletions

View file

@ -21,9 +21,18 @@ permalink: "/music/concerts/{% if pagination.pageNumber > 0 %}{{ pagination.page
<a href="{{ concert.artistUrl }}">{{ concert.artist.name }}</a>
{% endif %}
{%- endcapture -%}
{%- capture venue -%}
{% if concert.venue.name %}
{% if concert.venue.latitude and concert.venue.longitude %}
<a href="https://www.openstreetmap.org/?mlat={{ concert.venue.latitude }}&mlon={{ concert.venue.longitude }}#map=18/{{ concert.venue.latitude }}/{{ concert.venue.longitude }}">{{ concert.venue.name | formatVenue }}</a>
{% else %}
{{ concert.venue.name | formatVenue }}
{% endif %}
{% endif %}
{%- endcapture -%}
<li>
{{ artistName }} on <strong class="highlight-text">{{ concert.date | date: "%B %e, %Y" }}</strong>
{% if concert.venue.name %} at <a href="https://www.openstreetmap.org/?mlat={{ concert.venue.latitude }}&mlon={{ concert.venue.longitude }}#map=18/{{ concert.venue.latitude }}/{{ concert.venue.longitude }}">{{ concert.venue.name | formatVenue }}</a>{% endif %}
{% if venue %} at {{ venue }}{% endif %}
</li>
{% endfor %}
</ul>