diff --git a/pygeoapi/templates/_base.html b/pygeoapi/templates/_base.html
index 0aed269e3..bc082be81 100644
--- a/pygeoapi/templates/_base.html
+++ b/pygeoapi/templates/_base.html
@@ -37,7 +37,7 @@
- {% for link in data['links'] %}
+ {% for link in (links or data['links']) %}
{% if (link['rel']=="self" and link['type']=="text/html") %}
{% elif (link['rel']!="canonical") %}
@@ -80,25 +80,11 @@
{% trans %}Home{% endtrans %}
{% endblock %}
- {% 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 = link.href | string | safe %}
- {% trans %}json{% endtrans %}
- {% elif link['rel'] == 'alternate' and link['type'] and link['type'] == 'application/ld+json' %}
- {% set links_found.jsonld = link.href | string | safe %}
- {% trans %}jsonld{% endtrans %}
- {% endif %}
- {% endfor %}
-
- {% if links_found.json == '' %}
- {% trans %}json{% endtrans %}
- {% endif %}
- {% if links_found.jsonld == '' %}
- {% trans %}jsonld{% endtrans %}
- {% endif %}
-
+ {% for link in (links or data['links']) %}
+ {%- if link.get('rel') == 'alternate' -%}
+ {{ link.get('type').split('/')[-1] }}
+ {%- endif-%}
+ {% endfor %}
@@ -124,26 +110,31 @@
{% block extrafoot %}
{% endblock %}
-
{%- endif %}
- xhr.open('GET', path);
- xhr.onload = function() {
- if (xhr.status === 200) {
- var head = document.getElementsByTagName('head')[0];
- var jsonld_datablock = document.createElement('script');
- jsonld_datablock.type = "application/ld+json";
- //remove full context path, because search engines don't expect it here, pyld requires it.
- jsonld_datablock.textContent = xhr.responseText.replace('docs/jsonldcontext.jsonld','');
- head.appendChild(jsonld_datablock);
- }
- };
- xhr.send();
-
+ {% endfor %}