Skip to content

Commit

Permalink
Respected linkrel from provider (#1868)
Browse files Browse the repository at this point in the history
  • Loading branch information
webb-ben authored Dec 10, 2024
1 parent a0867d0 commit e27318f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pygeoapi/api/itemtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,12 @@ def get_collection_items(
serialized_query_params += '='
serialized_query_params += urllib.parse.quote(str(v), safe=',')

if 'links' not in content:
content['links'] = []

# TODO: translate titles
uri = f'{api.get_collections_url()}/{dataset}/items'
content['links'] = [{
content['links'].extend([{
'type': 'application/geo+json',
'rel': request.get_linkrel(F_JSON),
'title': l10n.translate('This document as GeoJSON', request.locale),
Expand All @@ -526,7 +529,7 @@ def get_collection_items(
'rel': request.get_linkrel(F_HTML),
'title': l10n.translate('This document as HTML', request.locale),
'href': f'{uri}?f={F_HTML}{serialized_query_params}'
}]
}])

if offset > 0:
prev = max(0, offset - limit)
Expand Down

0 comments on commit e27318f

Please sign in to comment.