diff --git a/iati_standard/models.py b/iati_standard/models.py index 8d2f5fb6..a32d82de 100644 --- a/iati_standard/models.py +++ b/iati_standard/models.py @@ -406,25 +406,10 @@ class ActivityStandardPage(AbstractGithubPage): template = 'iati_standard/activity_standard_page.html' - def get_sitemap_urls(self, request=None): - """If it's an older version of the standard, we want it to have a lower priority.""" - url = self.get_url(request) - if re.match(r"^\/\w+\/iati-standard\/", url) and not re.match(r"^\/\w+\/iati-standard\/203\/", url): - return [ - { - 'location': self.get_full_url(request), - 'lastmod': (self.last_published_at or self.latest_revision_created_at), - 'changefreq': 'yearly', - 'priority': .1, - } - ] - else: - return [ - { - 'location': self.get_full_url(request), - 'lastmod': (self.last_published_at or self.latest_revision_created_at), - } - ] + def is_older_version_of_standard(self): + """Is it an older version of the standard. Return Boolean.""" + url = self.get_url() + return re.match(r"^\/\w+\/iati-standard\/\d", url) and not re.match(r"^\/\w+\/iati-standard\/203\/", url) class StandardGuidancePage(AbstractGithubPage): diff --git a/iati_standard/templates/iati_standard/activity_standard_page.html b/iati_standard/templates/iati_standard/activity_standard_page.html index cd293fd6..e4567f20 100644 --- a/iati_standard/templates/iati_standard/activity_standard_page.html +++ b/iati_standard/templates/iati_standard/activity_standard_page.html @@ -23,6 +23,10 @@ {% endblock %} +{% block html_header_seo %} +{% if page.is_older_version_of_standard %}{% endif %} +{% endblock %} + {% block content %} {% get_current_language as LANGUAGE_CODE %}