From 9762bbfe79e62689f76f81748e9bc85ef504a9ac Mon Sep 17 00:00:00 2001 From: Benjamin Webb Date: Thu, 6 Mar 2025 12:52:04 -0500 Subject: [PATCH] Use JSON-LD link if found in HTML template --- pygeoapi/templates/_base.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pygeoapi/templates/_base.html b/pygeoapi/templates/_base.html index 27b58f92e..8d0cba99b 100644 --- a/pygeoapi/templates/_base.html +++ b/pygeoapi/templates/_base.html @@ -67,22 +67,22 @@ {% trans %}Home{% endtrans %} {% endblock %} - {% set links_found = namespace(json=0, jsonld=0) %} + {% set links_found = namespace(json='', jsonld='') %} {% for link in data['links'] %} {% if link['rel'] == 'alternate' and link['type'] and link['type'] in ['application/json', 'application/geo+json', 'application/prs.coverage+json'] %} - {% set links_found.json = 1 %} + {% set links_found.json = link.href | string | safe %} {% trans %}json{% endtrans %} {% elif link['rel'] == 'alternate' and link['type'] and link['type'] == 'application/ld+json' %} - {% set links_found.jsonld = 1 %} + {% set links_found.jsonld = link.href | string | safe %} {% trans %}jsonld{% endtrans %} {% endif %} {% endfor %} - {% if links_found.json == 0 %} + {% if links_found.json == '' %} {% trans %}json{% endtrans %} {% endif %} - {% if links_found.jsonld == 0 %} + {% if links_found.jsonld == '' %} {% trans %}jsonld{% endtrans %} {% endif %} @@ -114,7 +114,11 @@