summaryrefslogtreecommitdiff
path: root/sitemaps.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2014-11-08 16:31:38 -0600
committerDan McGee <dan@archlinux.org>2014-11-08 16:31:38 -0600
commit96a7614285325b693434f3fd011238000d75926d (patch)
tree243fab620a9fa57cd93c2412bde1f7190373caf0 /sitemaps.py
parent4c5b478543184ea395e0e692d3bcf666fb7513ad (diff)
Add a news-specific sitemap
This follows the spec at https://support.google.com/news/publisher/answer/74288?hl=en#tagdefinitions Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'sitemaps.py')
-rw-r--r--sitemaps.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/sitemaps.py b/sitemaps.py
index eb4e05d9..fb81357e 100644
--- a/sitemaps.py
+++ b/sitemaps.py
@@ -98,6 +98,13 @@ class NewsSitemap(Sitemap):
return 'yearly'
+class RecentNewsSitemap(NewsSitemap):
+ def items(self):
+ now = datetime.utcnow().replace(tzinfo=utc)
+ cutoff = now - timedelta(days=30)
+ return super(RecentNewsSitemap, self).items().filter(postdate__gte=cutoff)
+
+
class ReleasesSitemap(Sitemap):
changefreq = "monthly"