summaryrefslogtreecommitdiff
path: root/sitemaps.py
diff options
context:
space:
mode:
Diffstat (limited to 'sitemaps.py')
-rw-r--r--sitemaps.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/sitemaps.py b/sitemaps.py
new file mode 100644
index 00000000..9e2ef856
--- /dev/null
+++ b/sitemaps.py
@@ -0,0 +1,25 @@
+from django.contrib.sitemaps import Sitemap
+from archweb.main.models import Package, News
+
+class PackagesSitemap(Sitemap):
+ changefreq = "monthly"
+ priority = "0.4"
+
+ def items(self):
+ return Package.objects.all()
+
+ def lastmod(self, obj):
+ return obj.last_update
+
+class NewsSitemap(Sitemap):
+ changefreq = "never"
+ priority = "0.7"
+
+ def items(self):
+ return News.objects.all()
+
+ def lastmod(self, obj):
+ return obj.postdate
+
+# vim: set ts=4 sw=4 et:
+