Coverage for website/documents/sitemaps.py: 93.75%
16 statements
« prev ^ index » next coverage.py v7.6.7, created at 2025-08-14 10:31 +0000
« prev ^ index » next coverage.py v7.6.7, created at 2025-08-14 10:31 +0000
1from django.contrib import sitemaps
2from django.urls import reverse
4from . import models
7class StaticViewSitemap(sitemaps.Sitemap):
8 """Sitemap for the static pages."""
10 priority = 0.5
11 changefreq = "daily"
13 def items(self):
14 return ["documents:index"]
16 def location(self, item):
17 return reverse(item)
20class MiscellaneousDocumentsSitemap(sitemaps.Sitemap):
21 """Sitemap for misc documents."""
23 def items(self):
24 return models.MiscellaneousDocument.objects.exclude(members_only=True)
26 def location(self, item):
27 return item.get_absolute_url()
30sitemap = {
31 "documents-static": StaticViewSitemap,
32 "documents-miscellaneous": MiscellaneousDocumentsSitemap,
33}