diff --git a/eruditorg/apps/public/journal/urls.py b/eruditorg/apps/public/journal/urls.py index a3116b22e..b2f7e2b1f 100644 --- a/eruditorg/apps/public/journal/urls.py +++ b/eruditorg/apps/public/journal/urls.py @@ -49,7 +49,4 @@ # Compatibility URLs url('^', include(urls_compat.urlpatterns)), - - # Journal catchall - url(r'^(?P[\w-]+)/$', views.JournalDetailView.as_view(), name='journal_detail'), ] diff --git a/eruditorg/templates/base.html b/eruditorg/templates/base.html index 2aa8cf86f..3540805e1 100644 --- a/eruditorg/templates/base.html +++ b/eruditorg/templates/base.html @@ -46,6 +46,9 @@ {% block meta_tags %} {% endblock meta_tags %} + {% block structured_data %} + {% endblock structured_data %} + {% block stylesheets %} {% endblock stylesheets %} diff --git a/eruditorg/templates/public/base.html b/eruditorg/templates/public/base.html index 7f13adc4f..5c7bf108a 100644 --- a/eruditorg/templates/public/base.html +++ b/eruditorg/templates/public/base.html @@ -4,6 +4,23 @@ {% load rules %} {% load base_urls_tags %} +{% block structured_data %} + +{% endblock structured_data %} + {% block stylesheets %} {% if not WEBPACK_DEV_SERVER_URL %} diff --git a/eruditorg/templates/public/home.html b/eruditorg/templates/public/home.html index eeddcf400..0a036ac44 100644 --- a/eruditorg/templates/public/home.html +++ b/eruditorg/templates/public/home.html @@ -5,14 +5,44 @@ {% block page_title %}{% trans "Accueil" %}{% endblock page_title %} -{% block data_controller %}public:home{% endblock data_controller %} - -{% block body_class %}{{ block.super }} home{% endblock %} +{% block structured_data %} +{{ block.super }} + + +{% endblock structured_data %} {% block extrahead %} {% endblock extrahead %} +{% block data_controller %}public:home{% endblock data_controller %} +{% block body_class %}{{ block.super }} home{% endblock %} + {% block content %} {% trans "inconnu" as i18n_unknown %}
diff --git a/eruditorg/templates/public/journal/article_detail.html b/eruditorg/templates/public/journal/article_detail.html index 77c9dbdfc..602410cbf 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 %} @@ -65,20 +65,69 @@ {% endcache %} {% endblock meta_tags %} +{% block structured_data %} +{{ block.super }} +{% 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 %} {% 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 79f9e5ecc..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 %} @@ -63,20 +63,62 @@ {% endcache %} {% endblock meta_tags %} +{% block structured_data %} +{{ block.super }} +{% 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 %} {% 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..7cff649b4 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 %} @@ -7,10 +7,7 @@ {% block zone_title %}{{ journal.name }}{% endblock %} -{% block page_title %} -{% if issue.erudit_object.html_theme %}{{ issue.erudit_object.html_theme|safe }}. {% endif %} -{{ issue.volume_title_with_pages }} -{% endblock page_title %} +{% block page_title %}{% if issue.erudit_object.html_theme %}{{ issue.erudit_object.html_theme|safe }}. {% endif %}{{ issue.volume_title_with_pages }} - {{ issue.journal.name }}{% endblock page_title %} {% block meta_tags %} @@ -28,15 +25,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..57a23d76f 100644 --- a/eruditorg/templates/public/journal/journal_authors_list.html +++ b/eruditorg/templates/public/journal/journal_authors_list.html @@ -2,7 +2,52 @@ {% load i18n %} {% load public_journal_tags %} -{% block title %}{% trans "Index des auteurs" %}{% endblock title %} +{% block title %}{% trans "Index des auteurs" %} - {{ journal.name }}{% 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/journal/partials/article_structured_data.html b/eruditorg/templates/public/journal/partials/article_structured_data.html new file mode 100644 index 000000000..dab28f6f9 --- /dev/null +++ b/eruditorg/templates/public/journal/partials/article_structured_data.html @@ -0,0 +1,49 @@ +{% load i18n %} + + 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 %}