1
0
Fork 0
mirror of https://github.com/Findus23/acronomy.git synced 2024-09-19 15:33:45 +02:00
acronomy/acros/sitemaps.py

40 lines
756 B
Python
Raw Permalink Normal View History

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