Generate sitemaps XML#108
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
| from django.urls import reverse | ||
| from . import models | ||
|
|
||
| class AtlasSitemap(Sitemap): |
There was a problem hiding this comment.
[Super-Linter] reported by reviewdog 🐶
| class AtlasSitemap(Sitemap): | |
| class AtlasSitemap(Sitemap): |
|
|
||
| class AtlasSitemap(Sitemap): | ||
| """Sitemap for Cell Atlas pages.""" | ||
| changefreq = "weekly" |
There was a problem hiding this comment.
[Super-Linter] reported by reviewdog 🐶
| changefreq = "weekly" | |
| changefreq = "weekly" |
|
|
||
| def location(self, obj): | ||
| """Return the URL for the main page of a species.""" | ||
| return reverse('atlas_info', args=[obj.slug]) |
There was a problem hiding this comment.
[Super-Linter] reported by reviewdog 🐶
| return reverse('atlas_info', args=[obj.slug]) | |
| return reverse("atlas_info", args=[obj.slug]) |
|
|
||
| class StaticViewSitemap(Sitemap): | ||
| """Sitemap for static pages.""" | ||
| changefreq = "monthly" |
There was a problem hiding this comment.
[Super-Linter] reported by reviewdog 🐶
| changefreq = "monthly" | |
| changefreq = "monthly" |
| priority = 0.5 | ||
|
|
||
| def items(self): | ||
| return ['atlas', 'downloads', 'about', 'entry', 'reference', 'api'] |
There was a problem hiding this comment.
[Super-Linter] reported by reviewdog 🐶
| return ['atlas', 'downloads', 'about', 'entry', 'reference', 'api'] | |
| return ["atlas", "downloads", "about", "entry", "reference", "api"] |
| return ['atlas', 'downloads', 'about', 'entry', 'reference', 'api'] | ||
|
|
||
| def location(self, item): | ||
| return reverse(item) No newline at end of file |
There was a problem hiding this comment.
[Super-Linter] reported by reviewdog 🐶
| return reverse(item) | |
| return reverse(item) | |
| 'static': StaticViewSitemap, | ||
| 'dataset': AtlasSitemap, |
There was a problem hiding this comment.
[Super-Linter] reported by reviewdog 🐶
| 'static': StaticViewSitemap, | |
| 'dataset': AtlasSitemap, | |
| "static": StaticViewSitemap, | |
| "dataset": AtlasSitemap, |
| path('sitemap.xml', sitemap, {'sitemaps': sitemaps}, name='sitemap'), | ||
|
|
There was a problem hiding this comment.
[Super-Linter] reported by reviewdog 🐶
| path('sitemap.xml', sitemap, {'sitemaps': sitemaps}, name='sitemap'), | |
| path("sitemap.xml", sitemap, {"sitemaps": sitemaps}, name="sitemap"), |
Google already crawls the website pretty well. What is the point of having a quite manual way to do this? Not as dynamic as I would have hoped for: new Cell Atlas and Database Entry sections need to be included manually (unless we find a non-built-in way to automate it).
Also,
/api/crawling is now discouraged by robots.txt.