From 1457f78594a25f8cfb8ad1f9b3cd6d071a3d6a93 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 20 Feb 2013 18:57:34 -0600 Subject: 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 --- sitemaps.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'sitemaps.py') 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" -- cgit v1.2.3-24-g4f1b