diff --git a/pygeoapi-config.yml b/pygeoapi-config.yml index 0fc6d6c..adc193f 100644 --- a/pygeoapi-config.yml +++ b/pygeoapi-config.yml @@ -62,10 +62,12 @@ datasets: rel: canonical title: data href: https://github.com/mapserver/mapserver/blob/branch-7-0/msautotest/wxs/data/obs.csv + hreflang: en-US - type: text/csv rel: alternate title: data href: https://raw.githubusercontent.com/mapserver/mapserver/branch-7-0/msautotest/wxs/data/obs.csv + hreflang: en-US extents: spatial: bbox: [-180,-90,180,90] @@ -91,10 +93,12 @@ datasets: rel: canonical title: information href: http://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-populated-places/ + hreflang: en-US - type: application/gzip rel: canonical title: download href: http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_populated_places_simple.zip + hreflang: en-US extents: spatial: bbox: [-180,-90,180,90] @@ -115,6 +119,7 @@ datasets: rel: canonical title: information href: http://www.naturalearthdata.com/ + hreflang: en-US extents: spatial: bbox: [-180,-90,180,90] @@ -139,6 +144,7 @@ datasets: rel: canonical title: information href: http://www.naturalearthdata.com/ + hreflang: en-US extents: spatial: bbox: [-180,-90,180,90] diff --git a/pygeoapi/api.py b/pygeoapi/api.py index 728af61..a7d2ef5 100644 --- a/pygeoapi/api.py +++ b/pygeoapi/api.py @@ -104,7 +104,8 @@ class API(object): 'rel': 'self', 'type': 'text/html', 'title': 'this document as HTML', - 'href': '{}/?f=html'.format(self.config['server']['url']) + 'href': '{}/?f=html'.format(self.config['server']['url']), + 'hreflang': self.config['server']['language'] }, { 'rel': 'self', 'type': 'application/openapi+json;version=3.0', @@ -114,7 +115,8 @@ class API(object): 'rel': 'self', 'type': 'text/html', 'title': 'the OpenAPI definition as HTML', - 'href': '{}/api?f=html'.format(self.config['server']['url']) + 'href': '{}/api?f=html'.format(self.config['server']['url']), + 'hreflang': self.config['server']['language'] } ] @@ -241,6 +243,9 @@ class API(object): 'title': link['title'], 'href': link['href'] } + if 'hreflang' in link: + lnk['hreflang'] = link['hreflang'] + collection['links'].append(lnk) if dataset is not None and k == dataset: