summaryrefslogtreecommitdiffstats
path: root/sitemaps.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-02-21 01:57:34 +0100
committerDan McGee <dan@archlinux.org>2013-02-21 01:58:35 +0100
commit1457f78594a25f8cfb8ad1f9b3cd6d071a3d6a93 (patch)
tree43f33071863ea88beae8f0d89ef2a64981aff7ce /sitemaps.py
parent0491bdb2452e496b0a243e7abb3d15ef3fd71743 (diff)
downloadarchweb-1457f78594a25f8cfb8ad1f9b3cd6d071a3d6a93.tar.gz
archweb-1457f78594a25f8cfb8ad1f9b3cd6d071a3d6a93.tar.xz
Package sitemap adjustments
Adjust changefreq and priority based on the repository the package is in. Testing and staging have quick turnover so set the changefreq to 'daily'. Additionally, give staging packages a super low priority of 0.1 and testing a slightly lowered priority of 0.4. We didn't include staging packages before, but since search engines are finding them anyway, we might as well. This gives us a chance to share how important the page is as well, which they could only guess before. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'sitemaps.py')
-rw-r--r--sitemaps.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/sitemaps.py b/sitemaps.py
index b079d8b..d206a1b 100644
--- a/sitemaps.py
+++ b/sitemaps.py
@@ -11,17 +11,27 @@ from releng.models import Release
class PackagesSitemap(Sitemap):
- changefreq = "weekly"
- priority = "0.5"
-
def items(self):
- return Package.objects.normal().filter(repo__staging=False).only(
+ return Package.objects.normal().only(
'pkgname', 'last_update', 'files_last_update',
- 'repo__name', 'arch__name').order_by()
+ 'repo__name', 'repo__testing', 'repo__staging',
+ 'arch__name').order_by()
def lastmod(self, obj):
return obj.last_update
+ def changefreq(self, obj):
+ if obj.repo.testing or obj.repo.staging:
+ return "daily"
+ return "weekly"
+
+ def priority(self, obj):
+ if obj.repo.testing:
+ return "0.4"
+ if obj.repo.staging:
+ return "0.1"
+ return "0.5"
+
class PackageFilesSitemap(PackagesSitemap):
changefreq = "weekly"