Add posted entries to the sitemap

This commit is contained in:
Danielle McLean 2017-10-26 08:46:48 +11:00
parent 9d6cf902d1
commit dc99e7a39b
Signed by untrusted user: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
2 changed files with 15 additions and 0 deletions

13
entries/sitemaps.py Normal file
View file

@ -0,0 +1,13 @@
from django.contrib import sitemaps
from .models import Entry
class EntriesSitemap(sitemaps.Sitemap):
def items(self):
return Entry.objects.all()
def lastmod(self, entry):
return entry.updated
def location(self, entry):
return entry.url