Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SitemapBuildableView #48

Closed
wants to merge 5 commits into from
Closed

Add SitemapBuildableView #48

wants to merge 5 commits into from

Conversation

loicteixeira
Copy link
Collaborator

@loicteixeira loicteixeira commented Oct 29, 2019

Rebase & continue #38. Fix #37.

@loicteixeira
Copy link
Collaborator Author

Currently, sitemaps are build at the correct location for single and multisites, however the content is incorrect for multisites.

Despite creating a request which is multisites aware, and that request being passed to the Sitemap object, it then use the paginator which doesn't seem to be multisite aware and return pages of the default site. There's self.items which would be site aware but isn't used? So it could possibly be an upstream issue? Or I'm just all mixed up in the sitemap logic.

I'll leave this aside for a bit so I can focus on releasing a new version of the package and then come back to this.

@kaedroho kaedroho requested a review from tomdyson July 16, 2021 09:31
Copy link
Contributor

@tomdyson tomdyson left a comment

Choose a reason for hiding this comment

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

Thanks @loicteixeira, looks good!

We'll need some basic documentation, e.g. in the Configuration section of the README.



class SitemapBuildableView(BuildableMixin):

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have a comment to explain the function of this view?

view.request = view.create_request(view.sitemap_path)

content = view.get_content().decode()
expected_content = (
Copy link
Contributor

Choose a reason for hiding this comment

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

This test looks fragile. Should we assume that the exact formatting of Django's sitemap generation will be consistent across versions? As an alternative we could parse the XML and check for the namespace, a single <loc> element inside a single <url> element etc.

@loicteixeira loicteixeira mentioned this pull request Mar 18, 2023
@loicteixeira loicteixeira closed this by deleting the head repository Apr 2, 2024
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.

Add SitemapBuildableView
3 participants