Coverage for website/education/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 of the static pages."""
10 changefreq = "daily"
11 priority = 0.5
13 def items(self):
14 return ["education:books", "education:courses"]
16 def location(self, item):
17 return reverse(item)
20class CourseSitemap(sitemaps.Sitemap):
21 """Sitemap of the course pages."""
23 def items(self):
24 return models.Course.objects.all()
26 def location(self, item):
27 return item.get_absolute_url()
30sitemap = {
31 "education-static": StaticViewSitemap,
32 "education-courses": CourseSitemap,
33}