Source code for merchandise.sitemaps
"""Gives sitemaps for the merchandise package"""
from django.contrib import sitemaps
from django.urls import reverse
[docs]class StaticViewSitemap(sitemaps.Sitemap):
"""Generates the sitemap of the index page"""
changefreq = "monthly"
[docs] def items(self):
"""The items listed in the sitemap"""
return ["merchandise:index"]
[docs] def location(self, item):
"""Gives the location for the specified item
:param item: the item to generate the link to
:return: the URL to the item
"""
return reverse(item)
#: The site maps defined by this module
sitemap = {
"merchandise-static": StaticViewSitemap,
}