fmartingr
/
shelfzilla
Archived
1
0
Fork 0
This repository has been archived on 2021-06-29. You can view files and clone it, but cannot push or open issues or pull requests.
shelfzilla/shelfzilla/apps/blog/sitemap.py

17 lines
328 B
Python

from datetime import datetime
from django.contrib.sitemaps import Sitemap
from .models import Entry
class BlogSitemap(Sitemap):
changefreq = "monthly"
priority = 0.5
def items(self):
return Entry.objects.filter(draft=False, date__lte=datetime.now())
def lastmod(self, obj):
return obj.date