Skip to content

Adds support for repository sitemaps.#4398

Merged
joemull merged 5 commits into
masterfrom
b-3555-fuck-rebase
Sep 11, 2024
Merged

Adds support for repository sitemaps.#4398
joemull merged 5 commits into
masterfrom
b-3555-fuck-rebase

Conversation

@ajrbyers

Copy link
Copy Markdown
Member

Closes #3555

Comment thread src/press/views.py
Comment on lines +84 to +96
if request.journal is not None:
# if there's a journal, then we render the _journal_ sitemap, not the press
return journal_views.sitemap(request)

if request.repository is not None:
# if there is a repository we return the repository sitemap.
return repository_views.repository_sitemap(request)
if request.repository is not None:
# if there is a repository we return the repository sitemap.
return repository_views.sitemap(request)

return files.serve_sitemap_file(['sitemap.xml'])
except FileNotFoundError:
logger.warning('Sitemap for {} not found.'.format(request.press.name))
raise Http404()

return core_views.sitemap(
request,
['sitemap.xml'],
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking it makes more sense for core to redirect to the correct site type of press/journal/repository, to avoid the interdependence between the. That said, it does not currently present a circular import and Press already knows about journal and repository, so I'll leave this as an optional comment

@mauromsl mauromsl requested a review from joemull September 11, 2024 12:39
@mauromsl mauromsl assigned joemull and unassigned mauromsl Sep 11, 2024
@joemull joemull merged commit 60bc0b4 into master Sep 11, 2024
@joemull joemull deleted the b-3555-fuck-rebase branch September 11, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repository sitemaps aren't fully loading automatically

3 participants