From 3912cf1a4b04d644e06d5e41114067334e6a47fd Mon Sep 17 00:00:00 2001 From: Morgan Aubert Date: Mon, 25 Jul 2016 15:52:48 -0400 Subject: [PATCH] Add BreadcrumbList structured data --- eruditorg/templates/public/home.html | 14 +++++ .../public/journal/article_detail.html | 52 +++++++++++++++-- .../public/journal/article_summary.html | 45 ++++++++++++-- .../public/journal/issue_detail.html | 58 ++++++++++++++++--- .../public/journal/journal_authors_list.html | 45 ++++++++++++++ .../public/journal/journal_base.html | 7 --- .../public/journal/journal_detail.html | 39 ++++++++++++- .../journal/journal_list_per_disciplines.html | 32 +++++++++- .../journal/journal_list_per_names.html | 32 +++++++++- .../public/thesis/collection_home.html | 33 +++++++++++ .../public/thesis/collection_list_base.html | 32 ++++++++++ .../collection_list_per_author_name.html | 11 ++++ .../thesis/collection_list_per_year.html | 11 ++++ eruditorg/templates/public/thesis/home.html | 28 ++++++++- 14 files changed, 409 insertions(+), 30 deletions(-) delete mode 100644 eruditorg/templates/public/journal/journal_base.html diff --git a/eruditorg/templates/public/home.html b/eruditorg/templates/public/home.html index 33529f517..0a036ac44 100644 --- a/eruditorg/templates/public/home.html +++ b/eruditorg/templates/public/home.html @@ -20,6 +20,20 @@ } } + {% endblock structured_data %} {% block extrahead %} diff --git a/eruditorg/templates/public/journal/article_detail.html b/eruditorg/templates/public/journal/article_detail.html index 68c3c3f55..a1548f87d 100644 --- a/eruditorg/templates/public/journal/article_detail.html +++ b/eruditorg/templates/public/journal/article_detail.html @@ -1,4 +1,4 @@ -{% extends "public/journal/journal_base.html" %} +{% extends "public/base.html" %} {% load i18n staticfiles %} {% load public_journal_tags %} {% load cache %} @@ -68,6 +68,48 @@ {% cache FOREVER_TTL "public_article_detail_structured_data" article.id LANGUAGE_CODE %} {% include "public/journal/partials/article_structured_data.html" %} {% endcache %} + {% endblock structured_data %} {% block body_class %}public static-header{% endblock %} @@ -75,15 +117,15 @@ {% block header_class %}static{% endblock %} {% block breadcrumb %}{{ block.super }} - / {{ article.issue.journal.name }} - / + / {{ article.issue.journal.name }} + / {% if article.issue.erudit_object.html_theme %} {{ article.issue.erudit_object.html_theme|safe|truncatechars:50 }} {% else %} {{ article.issue.volume_title_with_pages }} {% endif %} - - / {{ article.title|truncatechars:50 }} + + / {{ article.title|truncatechars:50 }} {% endblock %} {% block content %} diff --git a/eruditorg/templates/public/journal/article_summary.html b/eruditorg/templates/public/journal/article_summary.html index 4dc7ce35e..da68bc288 100644 --- a/eruditorg/templates/public/journal/article_summary.html +++ b/eruditorg/templates/public/journal/article_summary.html @@ -1,4 +1,4 @@ -{% extends "public/journal/journal_base.html" %} +{% extends "public/base.html" %} {% load i18n staticfiles %} {% load public_journal_tags %} {% load cache %} @@ -68,6 +68,41 @@ {% cache FOREVER_TTL "public_article_summary_structured_data" article.id LANGUAGE_CODE %} {% include "public/journal/partials/article_structured_data.html" %} {% endcache %} + {% endblock structured_data %} {% block body_class %}public static-header{% endblock %} @@ -75,15 +110,15 @@ {% block header_class %}static{% endblock %} {% block breadcrumb %}{{ block.super }} - / {{ article.issue.journal.name }} - / + / {{ article.issue.journal.name }} + / {% if article.issue.erudit_object.html_theme %} {{ article.issue.erudit_object.html_theme|safe|truncatechars:50 }} {% else %} {{ article.issue.volume_title_with_pages }} {% endif %} - - / {% blocktrans with title=article.title|truncatechars:50 %}{{ title }} - Résumé{% endblocktrans %} + + / {% blocktrans with title=article.title|truncatechars:50 %}{{ title }} - Résumé{% endblocktrans %} {% endblock %} {% block content %} diff --git a/eruditorg/templates/public/journal/issue_detail.html b/eruditorg/templates/public/journal/issue_detail.html index 13d1da6a2..53ce7e6aa 100644 --- a/eruditorg/templates/public/journal/issue_detail.html +++ b/eruditorg/templates/public/journal/issue_detail.html @@ -1,4 +1,4 @@ -{% extends "public/journal/journal_base.html" %} +{% extends "public/base.html" %} {% load i18n %} {% load staticfiles %} {% load cache %} @@ -28,15 +28,55 @@ {% endblock meta_tags %} +{% block structured_data %} +{{ block.super }} + +{% endblock structured_data %} + {% block breadcrumb %}{{ block.super }} -/ - - {% if issue.erudit_object.html_theme %} - {{ issue.erudit_object.html_theme|safe|truncatechars:50 }} - {% else %} - {{ issue.volume_title_with_pages }} - {% endif %} - + / {% trans "Revues" %} + / {{ issue.journal.name }} + / + {% if issue.erudit_object.html_theme %} + {{ issue.erudit_object.html_theme|safe|truncatechars:50 }} + {% else %} + {{ issue.volume_title_with_pages }} + {% endif %} + {% endblock %} {% block content %} diff --git a/eruditorg/templates/public/journal/journal_authors_list.html b/eruditorg/templates/public/journal/journal_authors_list.html index e60701961..90c430bba 100644 --- a/eruditorg/templates/public/journal/journal_authors_list.html +++ b/eruditorg/templates/public/journal/journal_authors_list.html @@ -4,6 +4,51 @@ {% block title %}{% trans "Index des auteurs" %}{% endblock title %} +{% block structured_data %} +{{ block.super }} + +{% endblock structured_data %} + +{% block breadcrumb %} + {{ block.super }} / {% trans "Revues" %} + / {{ journal.name }} + / {% trans "Auteurs" %} +{% endblock %} + {% block content %}
diff --git a/eruditorg/templates/public/journal/journal_base.html b/eruditorg/templates/public/journal/journal_base.html deleted file mode 100644 index f8570d91e..000000000 --- a/eruditorg/templates/public/journal/journal_base.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends "public/base.html" %} -{% load i18n %} - -{% block breadcrumb %} - {{ block.super }} / {% trans "Revues" %} - {% if journal %} / {{ journal.name }}{% endif %} -{% endblock %} diff --git a/eruditorg/templates/public/journal/journal_detail.html b/eruditorg/templates/public/journal/journal_detail.html index a4de48f15..e1441ab8f 100644 --- a/eruditorg/templates/public/journal/journal_detail.html +++ b/eruditorg/templates/public/journal/journal_detail.html @@ -1,4 +1,4 @@ -{% extends "public/journal/journal_base.html" %} +{% extends "public/base.html" %} {% load i18n staticfiles cache %} {% block page_title %}{{ journal.name }}{% endblock page_title %} @@ -19,6 +19,43 @@ {% endblock meta_tags %} +{% block structured_data %} +{{ block.super }} + +{% endblock structured_data %} + +{% block breadcrumb %}{{ block.super }} + / {% trans "Revues" %} + / {{ journal.name }} +{% endblock %} + {% block content %} {% trans "inconnu" as i18n_unknown %} diff --git a/eruditorg/templates/public/journal/journal_list_per_disciplines.html b/eruditorg/templates/public/journal/journal_list_per_disciplines.html index 6c1b4066f..d3fff034a 100644 --- a/eruditorg/templates/public/journal/journal_list_per_disciplines.html +++ b/eruditorg/templates/public/journal/journal_list_per_disciplines.html @@ -1,12 +1,42 @@ -{% extends "public/journal/journal_base.html" %} +{% extends "public/base.html" %} {% load i18n %} {% load static %} {% load cache %} {% block page_title %}{% trans "Revues" %}{% endblock page_title %} + +{% block structured_data %} +{{ block.super }} + +{% endblock structured_data %} + {% block body_class %}{{ block.super }} journal_list_per_disciplines{% endblock %} {% block data_controller %}public:journal:journal_list{% endblock data_controller %} +{% block breadcrumb %}{{ block.super }} + / {% trans "Revues" %} +{% endblock %} + {% block content %}
diff --git a/eruditorg/templates/public/journal/journal_list_per_names.html b/eruditorg/templates/public/journal/journal_list_per_names.html index 3aa339bd9..5c2cdf799 100644 --- a/eruditorg/templates/public/journal/journal_list_per_names.html +++ b/eruditorg/templates/public/journal/journal_list_per_names.html @@ -1,14 +1,44 @@ -{% extends "public/journal/journal_base.html" %} +{% extends "public/base.html" %} {% load i18n %} {% load static %} {% load cache %} {% load widget_tweaks %} {% block page_title %}{% trans "Revues" %}{% endblock page_title %} + +{% block structured_data %} +{{ block.super }} + +{% endblock structured_data %} + {% block body_class %}{{ block.super }} journal_list{% endblock %} {% block data_controller %}public:journal:journal_list{% endblock data_controller %} {% block body_data_attributes %} data-spy="scroll" data-target="#journal_list_per_names" data-offset="180"{% endblock body_data_attributes %} +{% block breadcrumb %}{{ block.super }} + / {% trans "Revues" %} +{% endblock %} + {% block content %}
diff --git a/eruditorg/templates/public/thesis/collection_home.html b/eruditorg/templates/public/thesis/collection_home.html index c2d037237..ebbc225b2 100644 --- a/eruditorg/templates/public/thesis/collection_home.html +++ b/eruditorg/templates/public/thesis/collection_home.html @@ -2,6 +2,39 @@ {% load i18n %} {% block page_title %}{{ collection.name }}{% endblock page_title %} + +{% block structured_data %} +{{ block.super }} + +{% endblock structured_data %} + {% block body_class %}{{ block.super }} thesis_collection_home{% endblock body_class %} {% block data_controller %}public:thesis:collection_home{% endblock data_controller %} diff --git a/eruditorg/templates/public/thesis/collection_list_base.html b/eruditorg/templates/public/thesis/collection_list_base.html index c0121da8d..a02e64734 100644 --- a/eruditorg/templates/public/thesis/collection_list_base.html +++ b/eruditorg/templates/public/thesis/collection_list_base.html @@ -1,6 +1,38 @@ {% extends "public/base.html" %} {% load i18n %} +{% block structured_data %} +{{ block.super }} + +{% endblock structured_data %} + {% block body_class %}{{ block.super }} thesis_collection_list{% endblock body_class %} {% block data_controller %}public:thesis:collection_list{% endblock data_controller %} diff --git a/eruditorg/templates/public/thesis/collection_list_per_author_name.html b/eruditorg/templates/public/thesis/collection_list_per_author_name.html index 4b117d3d6..5677103ee 100644 --- a/eruditorg/templates/public/thesis/collection_list_per_author_name.html +++ b/eruditorg/templates/public/thesis/collection_list_per_author_name.html @@ -3,6 +3,17 @@ {% block page_title %}{% blocktrans with letter=author_letter %}Thèses par auteur commençant par {{ letter }}{% endblocktrans %} – {{ collection.name }}{% endblock page_title %} +{% block structured_data_breadcrumb_tail %} +{ + "@type": "ListItem", + "position": 4, + "item": { + "@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:thesis:collection_list_per_author_name' collection.pk author_letter %}", + "name": "{% blocktrans with letter=author_letter %}Thèses par auteur commençant par {{ letter }}{% endblocktrans %}" + } +} +{% endblock structured_data_breadcrumb_tail %} + {% block breadcrumb %} {{ block.super }} / {% blocktrans with letter=author_letter %}Thèses par auteur commençant par {{ letter }}{% endblocktrans %} {% endblock breadcrumb %} diff --git a/eruditorg/templates/public/thesis/collection_list_per_year.html b/eruditorg/templates/public/thesis/collection_list_per_year.html index d924586c2..2f7e073b4 100644 --- a/eruditorg/templates/public/thesis/collection_list_per_year.html +++ b/eruditorg/templates/public/thesis/collection_list_per_year.html @@ -3,6 +3,17 @@ {% block page_title %}{% blocktrans with year=publication_year %}Thèses publiées en {{ year }}{% endblocktrans %} – {{ collection.name }}{% endblock page_title %} +{% block structured_data_breadcrumb_tail %} +{ + "@type": "ListItem", + "position": 4, + "item": { + "@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:thesis:collection_list_per_year' collection.pk publication_year %}", + "name": "{{ publication_year }}" + } +} +{% endblock structured_data_breadcrumb_tail %} + {% block breadcrumb %} {{ block.super }} / {{ publication_year }} {% endblock breadcrumb %} diff --git a/eruditorg/templates/public/thesis/home.html b/eruditorg/templates/public/thesis/home.html index 6aa466658..6753c1e7c 100644 --- a/eruditorg/templates/public/thesis/home.html +++ b/eruditorg/templates/public/thesis/home.html @@ -2,11 +2,37 @@ {% load i18n %} {% block page_title %}{% trans "Thèses" %}{% endblock page_title %} + +{% block structured_data %} +{{ block.super }} + +{% endblock structured_data %} + {% block body_class %}{{ block.super }} thesis_home{% endblock body_class %} {% block data_controller %}public:thesis:thesis_home{% endblock data_controller %} {% block breadcrumb %} - {{ block.super }} / {% trans "Thèses" %} + {{ block.super }} / {% trans "Thèses" %} {% endblock breadcrumb %} {% block content %}