Skip to content

Commit

Permalink
Update sitemap.py
Browse files Browse the repository at this point in the history
  • Loading branch information
webb-ben committed Jul 31, 2023
1 parent 8c9d45b commit c33ef28
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pygeoapi_plugins/process/sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ def execute(self, data):
LOGGER.debug('Generating core.xml')
oas = {'features': []}
for path in get_oas(self.config)['paths']:
path_uri = url_join(self.base_url, path)
oas['features'].append({'@id': path_uri})
if 'featureId' not in path:
path_uri = url_join(self.base_url, path)
oas['features'].append({'@id': path_uri})
outputs['core.xml'] = self.xml.write(data=oas)

LOGGER.debug('Generating collections sitemap')
Expand All @@ -160,7 +161,7 @@ def execute(self, data):
with zipfile.ZipFile(zip_output, 'w') as zipf:
for filename, content in outputs.items():
zipf.writestr(filename, content)
return mimetype, {'sitemap': zip_output.read()}
return 'application/zip', zip_output.getvalue()

else:
return mimetype, outputs
Expand Down

0 comments on commit c33ef28

Please sign in to comment.