Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Merge branch 'master' into feature/collection-sitemap

Filip Kucharczyka276919d7403
diff --cc saleor/core/sitemaps.py
index 1e2dae53b6,9ebfd0c0e5..d968c4120f
--- a/saleor/core/sitemaps.py
+++ b/saleor/core/sitemaps.py
@@@ -1,6 -1,7 +1,7 @@@
from django.contrib.sitemaps import Sitemap
+ from ..page.models import Page
-from ..product.models import Category, Product
+from ..product.models import Category, Collection, Product
class ProductSitemap(Sitemap):
@@@ -16,14 -17,14 +17,22 @@@ class CategorySitemap(Sitemap)
return categories.only('id', 'name', 'slug')
+class CollectionSitemap(Sitemap):
+
+ def items(self):
+ collections = Collection.objects.all().order_by('id')
+ return collections.only('id', 'name', 'slug')
+
+
+ class PageSitemap(Sitemap):
+
+ def items(self):
+ posts = Page.objects.public()
+ return posts.only('id', 'title', 'slug')
+
+
sitemaps = {
'categories': CategorySitemap,
+ 'collections': CollectionSitemap,
- 'products': ProductSitemap}
+ 'products': ProductSitemap,
+ 'pages': PageSitemap}