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 f48c434
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pygeoapi_plugins/process/sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
'schema': {
'type': 'boolean',
'default': True
'default': False
},
'minOccurs': 0,
'maxOccurs': 1,
Expand All @@ -102,7 +102,7 @@
},
'example': {
'inputs': {
'zip': True
'zip': False
}
}
})
Expand Down 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 f48c434

Please sign in to comment.