diff options
author | Dan McGee <dan@archlinux.org> | 2012-08-04 19:44:55 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-08-04 19:44:55 -0500 |
commit | a87864f6d05250c9b07b8b9eaecae669505c7f38 (patch) | |
tree | e7525bd4da08a945eb1c7df72554c53cf878b84a | |
parent | cdbbf81f49a9b82fcadcdb795de5d543cd0af916 (diff) |
Slight adjustments to sitemaps priority values
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | sitemaps.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sitemaps.py b/sitemaps.py index 424168bf..97ab43c0 100644 --- a/sitemaps.py +++ b/sitemaps.py @@ -60,8 +60,6 @@ class SplitPackagesSitemap(Sitemap): class NewsSitemap(Sitemap): - priority = "0.8" - def __init__(self): now = datetime.utcnow().replace(tzinfo=utc) self.one_day_ago = now - timedelta(days=1) @@ -73,6 +71,11 @@ class NewsSitemap(Sitemap): def lastmod(self, obj): return obj.last_modified + def priority(self, obj): + if obj.last_modified > self.one_week_ago: + return "0.9" + return "0.8" + def changefreq(self, obj): if obj.last_modified > self.one_day_ago: return 'daily' @@ -82,9 +85,12 @@ class NewsSitemap(Sitemap): class BaseSitemap(Sitemap): + DEFAULT_PRIORITY = 0.7 + base_viewnames = ( ('index', 1.0, 'hourly'), ('packages-search', 0.8, 'hourly'), + ('page-download', 0.8, 'monthly'), ('page-keys', 0.8, 'weekly'), ('news-list', 0.7, 'weekly'), ('groups-list', 0.5, 'weekly'), @@ -96,7 +102,6 @@ class BaseSitemap(Sitemap): 'page-tus', 'page-fellows', 'page-donate', - 'page-download', 'feeds-list', 'mirror-list', 'mirrorlist', @@ -117,7 +122,7 @@ class BaseSitemap(Sitemap): def priority(self, obj): if isinstance(obj, tuple): return obj[1] - return 0.7 + return self.DEFAULT_PRIORITY def changefreq(self, obj): if isinstance(obj, tuple): |