diff --git a/config/media.yaml b/config/media.yaml index d27ee85..c8c8836 100644 --- a/config/media.yaml +++ b/config/media.yaml @@ -1,4 +1,4 @@ -gpx: +types: + gpx: type: file - extensions: ['gpx'] mime: application/gpx+xml diff --git a/themes/intotheeast/templates/map.html.twig b/themes/intotheeast/templates/map.html.twig index 0c13960..2ab9765 100644 --- a/themes/intotheeast/templates/map.html.twig +++ b/themes/intotheeast/templates/map.html.twig @@ -1,9 +1,17 @@ {% extends 'partials/base.html.twig' %} {% block content %} +{% set trip_page = page.parent() %} {% set tracker_page = grav.pages.find(page.parent().route ~ '/dailies') %} {% set all_entries = tracker_page ? tracker_page.children.published() : [] %} +{% set gpx_urls = [] %} +{% for name, media in trip_page.media.all %} + {% if name|split('.')|last == 'gpx' %} + {% set gpx_urls = gpx_urls|merge([trip_page.url ~ '/' ~ name]) %} + {% endif %} +{% endfor %} + {% set map_entries = [] %} {% for entry in all_entries %} {% if entry.header.lat is not empty and entry.header.lng is not empty %} @@ -28,6 +36,7 @@ +