diff --git a/iati/templates/base.html b/iati/templates/base.html index c93ab15b..05b8bcff 100644 --- a/iati/templates/base.html +++ b/iati/templates/base.html @@ -39,6 +39,9 @@ {% block extra_css %} {# Override this in templates to add extra stylesheets #} {% endblock %} + + {% block html_header_seo %} + {% endblock %} diff --git a/iati_standard/models.py b/iati_standard/models.py index 1d13e9c0..a32d82de 100644 --- a/iati_standard/models.py +++ b/iati_standard/models.py @@ -1,6 +1,7 @@ """Model definitions for the iati_standard app.""" import os +import re from bs4 import BeautifulSoup from datetime import datetime @@ -397,10 +398,19 @@ def save(self, *args, **kwargs): class ActivityStandardPage(AbstractGithubPage): - """A model for the Activity Standard Page, an IATI reference page.""" + """A model for the Activity Standard Page, an IATI reference page. + + Used for Standard reference pages like /en/iati-standard/202/ + And guidance developer pages like /en/guidance/developer/ + """ template = 'iati_standard/activity_standard_page.html' + 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): """A model for the Standard Guidance Page, an IATI reference page.""" 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 %}