feat: add important locations and buying to sitemap and fix

This commit is contained in:
2025-07-14 06:33:12 +02:00
parent 9f53836ce8
commit 5a6c2c99e5
3 changed files with 18 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
from django.contrib.sitemaps import Sitemap
from django.urls import reverse
from .models import AdoptionNotice, RescueOrganization
from .models import AdoptionNotice, RescueOrganization, ImportantLocation, Animal
class StaticViewSitemap(Sitemap):
@@ -8,7 +8,8 @@ class StaticViewSitemap(Sitemap):
changefreq = "weekly"
def items(self):
return ["index", "search", "map", "about", "rescue-organizations"]
return ["index", "search", "map", "about", "rescue-organizations", "buying", "imprint", "terms-of-service",
"privacy"]
def location(self, item):
return reverse(item)
@@ -25,17 +26,6 @@ class AdoptionNoticeSitemap(Sitemap):
return obj.updated_at
class AnimalSitemap(Sitemap):
priority = 0.2
changefreq = "daily"
def items(self):
return AdoptionNotice.objects.all()
def lastmod(self, obj):
return obj.updated_at
class RescueOrganizationSitemap(Sitemap):
priority = 0.3
changefreq = "weekly"
@@ -45,3 +35,11 @@ class RescueOrganizationSitemap(Sitemap):
def lastmod(self, obj):
return obj.updated_at
class SearchSitemap(Sitemap):
priority = 0.5
chanfreq = "daily"
def items(self):
return ImportantLocation.objects.all()