Skip to content

Commit 491ceaf

Browse files
authored
fix collection breadcrumbs on queryables and schemas HTML Jinja2 templates (geopython#1769)
1 parent d1dfa17 commit 491ceaf

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

pygeoapi/api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,7 @@ def get_collection_schema(self, request: Union[APIRequest, Any],
13821382
self.config['resources'][dataset]['title'], request.locale)
13831383

13841384
schema['collections_path'] = self.get_collections_url()
1385+
schema['dataset_path'] = f'{self.get_collections_url()}/{dataset}'
13851386

13861387
content = render_j2_template(self.tpl_config,
13871388
'collections/schema.html',

pygeoapi/api/itemtypes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ def get_collection_queryables(api: API, request: Union[APIRequest, Any],
188188
api.config['resources'][dataset]['title'], request.locale)
189189

190190
queryables['collections_path'] = api.get_collections_url()
191+
queryables['dataset_path'] = f'{api.get_collections_url()}/{dataset}'
191192

192193
content = render_j2_template(api.tpl_config,
193194
'collections/queryables.html',

pygeoapi/templates/collections/queryables.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% block title %}{{ super() }} {{ data['title'] }} {% endblock %}
33
{% block crumbs %}{{ super() }}
44
/ <a href="{{ data['collections_path'] }}">{% trans %}Collections{% endtrans %}</a>
5-
/ <a href="./{{ data['id'] }}">{{ data['title'] | truncate( 25 ) }}</a>
5+
/ <a href="{{ data['dataset_path'] }}">{{ data['title'] | truncate( 25 ) }}</a>
66
/ <a href="./{{ data['id'] }}queryables">{% trans %}Queryables{% endtrans %}</a>
77
{% endblock %}
88
{% block body %}

pygeoapi/templates/collections/schema.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% block title %}{{ super() }} {{ data['title'] }} {% endblock %}
33
{% block crumbs %}{{ super() }}
44
/ <a href="{{ data['collections_path'] }}">{% trans %}Collections{% endtrans %}</a>
5-
/ <a href="./{{ data['id'] }}">{{ data['title'] | truncate( 25 ) }}</a>
5+
/ <a href="{{ data['dataset_path'] }}">{{ data['title'] | truncate( 25 ) }}</a>
66
/ <a href="./{{ data['id'] }}schema">{% trans %}Schema{% endtrans %}</a>
77
{% endblock %}
88
{% block body %}

0 commit comments

Comments
 (0)