24 lines
625 B
Python
24 lines
625 B
Python
"""Add News and static pages to the global sitemap."""
|
|
from kasu.sitemaps import GenericSitemap
|
|
from .models import Article, Page
|
|
|
|
|
|
class ArticleSitemap(GenericSitemap):
|
|
"""Add all published news articles to the Sitemap."""
|
|
min_priority = 0.25
|
|
|
|
@staticmethod
|
|
def items(**kwargs):
|
|
"""only add published articles to the sitemap"""
|
|
return Article.objects.published()
|
|
|
|
|
|
class PageSitemap(GenericSitemap):
|
|
"""add the static pages to the sitemap."""
|
|
min_priority = 0.5
|
|
|
|
@staticmethod
|
|
def items(**kwargs):
|
|
"""add all pages to the sitemap."""
|
|
return Page.objects.all()
|