diff options
Diffstat (limited to 'sitemaps.py')
-rw-r--r-- | sitemaps.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sitemaps.py b/sitemaps.py index b079d8b7..d206a1b6 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" |