2020-06-08 20:33:29 +02:00
|
|
|
from django.contrib.sitemaps import Sitemap
|
2020-07-26 14:24:36 +02:00
|
|
|
from django.urls import reverse
|
2020-06-08 20:33:29 +02:00
|
|
|
|
2020-07-26 14:24:36 +02:00
|
|
|
from .models import Acronym, Tag
|
2020-06-08 20:33:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
class AcronymSitemap(Sitemap):
|
|
|
|
changefreq = "weekly"
|
|
|
|
priority = 0.8
|
|
|
|
|
|
|
|
def items(self):
|
|
|
|
return Acronym.objects.all()
|
|
|
|
|
|
|
|
def lastmod(self, obj: Acronym):
|
|
|
|
return obj.modified_date
|
2020-07-26 14:24:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
class TagsSitemap(Sitemap):
|
|
|
|
changefreq = "weekly"
|
|
|
|
priority = 0.5
|
|
|
|
|
|
|
|
def items(self):
|
|
|
|
return Tag.objects.all()
|
|
|
|
|
|
|
|
|
|
|
|
class StaticPagesSitemap(Sitemap):
|
|
|
|
changefreq = "weekly"
|
|
|
|
priority = 0.9
|
|
|
|
|
|
|
|
def items(self):
|
|
|
|
return [
|
|
|
|
reverse("index"),
|
|
|
|
reverse("overview"),
|
|
|
|
reverse("tags"),
|
|
|
|
reverse("integrations")
|
|
|
|
]
|
|
|
|
|
|
|
|
def location(self, url):
|
|
|
|
return url
|