Skip to content

Commit

Permalink
Add BreadcrumbList structured data
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan Aubert committed Jul 26, 2016
1 parent 33504ce commit 3912cf1
Show file tree
Hide file tree
Showing 14 changed files with 409 additions and 30 deletions.
14 changes: 14 additions & 0 deletions eruditorg/templates/public/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@
}
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}",
"name": "Érudit"
}
}]
}
</script>
{% endblock structured_data %}

{% block extrahead %}
Expand Down
52 changes: 47 additions & 5 deletions eruditorg/templates/public/journal/article_detail.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "public/journal/journal_base.html" %}
{% extends "public/base.html" %}
{% load i18n staticfiles %}
{% load public_journal_tags %}
{% load cache %}
Expand Down Expand Up @@ -68,22 +68,64 @@
{% cache FOREVER_TTL "public_article_detail_structured_data" article.id LANGUAGE_CODE %}
{% include "public/journal/partials/article_structured_data.html" %}
{% endcache %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}",
"name": "Érudit"
}
},{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_list' %}",
"name": "{% trans 'Revues' %}"
}
},{
"@type": "ListItem",
"position": 3,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_detail' article.issue.journal.code %}",
"name": "{{ article.issue.journal.name }}"
}
},{
"@type": "ListItem",
"position": 4,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:issue_detail' article.issue.journal.code article.issue.volume_slug article.issue.localidentifier %}",
"name": "{{ article.issue.volume_title_with_pages }}"
}
},{
"@type": "ListItem",
"position": 5,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:article_detail' article.issue.journal.code article.issue.volume_slug article.issue.localidentifier article.localidentifier %}",
"name": "{{ article.title }}"
}
}]
}
</script>
{% endblock structured_data %}

{% block body_class %}public static-header{% endblock %}

{% block header_class %}static{% endblock %}

{% block breadcrumb %}{{ block.super }}
/ <a href="{% url 'public:journal:journal_detail' article.issue.journal.code %}">{{ article.issue.journal.name }}</a>
/ <a href="{% url 'public:journal:issue_detail' article.issue.journal.code article.issue.volume_slug article.issue.localidentifier %}">
/ <a href="{% url 'public:journal:journal_detail' article.issue.journal.code %}">{{ article.issue.journal.name }}</a>
/ <a href="{% url 'public:journal:issue_detail' article.issue.journal.code article.issue.volume_slug article.issue.localidentifier %}">
{% if article.issue.erudit_object.html_theme %}
{{ article.issue.erudit_object.html_theme|safe|truncatechars:50 }}
{% else %}
{{ article.issue.volume_title_with_pages }}
{% endif %}
</a>
/ <a>{{ article.title|truncatechars:50 }}</a>
</a>
/ <a href="{% url 'public:journal:article_detail' article.issue.journal.code article.issue.volume_slug article.issue.localidentifier article.localidentifier %}">{{ article.title|truncatechars:50 }}</a>
{% endblock %}

{% block content %}
Expand Down
45 changes: 40 additions & 5 deletions eruditorg/templates/public/journal/article_summary.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "public/journal/journal_base.html" %}
{% extends "public/base.html" %}
{% load i18n staticfiles %}
{% load public_journal_tags %}
{% load cache %}
Expand Down Expand Up @@ -68,22 +68,57 @@
{% cache FOREVER_TTL "public_article_summary_structured_data" article.id LANGUAGE_CODE %}
{% include "public/journal/partials/article_structured_data.html" %}
{% endcache %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}",
"name": "Érudit"
}
},{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_list' %}",
"name": "{% trans 'Revues' %}"
}
},{
"@type": "ListItem",
"position": 3,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_detail' article.issue.journal.code %}",
"name": "{{ article.issue.journal.name }}"
}
},{
"@type": "ListItem",
"position": 5,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:article_summary' article.issue.journal.code article.issue.volume_slug article.issue.localidentifier article.localidentifier %}",
"name": "{{ article.title }}"
}
}]
}
</script>
{% endblock structured_data %}

{% block body_class %}public static-header{% endblock %}

{% block header_class %}static{% endblock %}

{% block breadcrumb %}{{ block.super }}
/ <a href="{% url 'public:journal:journal_detail' article.issue.journal.code %}">{{ article.issue.journal.name }}</a>
/ <a href="{% url 'public:journal:issue_detail' article.issue.journal.code article.issue.volume_slug article.issue.localidentifier %}">
/ <a href="{% url 'public:journal:journal_detail' article.issue.journal.code %}">{{ article.issue.journal.name }}</a>
/ <a href="{% url 'public:journal:issue_detail' article.issue.journal.code article.issue.volume_slug article.issue.localidentifier %}">
{% if article.issue.erudit_object.html_theme %}
{{ article.issue.erudit_object.html_theme|safe|truncatechars:50 }}
{% else %}
{{ article.issue.volume_title_with_pages }}
{% endif %}
</a>
/ <a>{% blocktrans with title=article.title|truncatechars:50 %}{{ title }} - Résumé{% endblocktrans %}</a>
</a>
/ <a href="{% url 'public:journal:article_summary' article.issue.journal.code article.issue.volume_slug article.issue.localidentifier article.localidentifier %}">{% blocktrans with title=article.title|truncatechars:50 %}{{ title }} - Résumé{% endblocktrans %}</a>
{% endblock %}

{% block content %}
Expand Down
58 changes: 49 additions & 9 deletions eruditorg/templates/public/journal/issue_detail.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "public/journal/journal_base.html" %}
{% extends "public/base.html" %}
{% load i18n %}
{% load staticfiles %}
{% load cache %}
Expand Down Expand Up @@ -28,15 +28,55 @@
<meta name="twitter:title" content="{{ issue.erudit_object.html_theme|safe }} – Érudit">
{% endblock meta_tags %}

{% block structured_data %}
{{ block.super }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}",
"name": "Érudit"
}
},{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_list' %}",
"name": "{% trans 'Revues' %}"
}
},{
"@type": "ListItem",
"position": 3,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_detail' issue.journal.code %}",
"name": "{{ issue.journal.name }}"
}
},{
"@type": "ListItem",
"position": 4,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:issue_detail' issue.journal.code issue.volume_slug issue.localidentifier %}",
"name": "{{ issue.volume_title_with_pages }}"
}
}]
}
</script>
{% endblock structured_data %}

{% block breadcrumb %}{{ block.super }}
/
<a href="{% url 'public:journal:issue_detail' issue.journal.code issue.volume_slug issue.localidentifier %}">
{% if issue.erudit_object.html_theme %}
{{ issue.erudit_object.html_theme|safe|truncatechars:50 }}
{% else %}
{{ issue.volume_title_with_pages }}
{% endif %}
</a>
/ <a href="{% url 'public:journal:journal_list' %}">{% trans "Revues" %}</a>
/ <a href="{% url 'public:journal:journal_detail' journal.code %}">{{ issue.journal.name }}</a>
/ <a href="{% url 'public:journal:issue_detail' issue.journal.code issue.volume_slug issue.localidentifier %}">
{% if issue.erudit_object.html_theme %}
{{ issue.erudit_object.html_theme|safe|truncatechars:50 }}
{% else %}
{{ issue.volume_title_with_pages }}
{% endif %}
</a>
{% endblock %}

{% block content %}
Expand Down
45 changes: 45 additions & 0 deletions eruditorg/templates/public/journal/journal_authors_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,51 @@

{% block title %}{% trans "Index des auteurs" %}{% endblock title %}

{% block structured_data %}
{{ block.super }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}",
"name": "Érudit"
}
},{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_list' %}",
"name": "{% trans 'Revues' %}"
}
},{
"@type": "ListItem",
"position": 3,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_detail' journal.code %}",
"name": "{{ article.issue.journal.name }}"
}
},{
"@type": "ListItem",
"position": 4,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_authors_list' journal.code %}",
"name": "{% trans 'Auteurs' %}"
}
}]
}
</script>
{% endblock structured_data %}

{% block breadcrumb %}
{{ block.super }} / <a href="{% url 'public:journal:journal_list' %}">{% trans "Revues" %}</a>
/ <a href="{% url 'public:journal:journal_detail' journal.code %}">{{ journal.name }}</a>
/ <a href="{% url 'public:journal:journal_authors_list' journal.code %}">{% trans "Auteurs" %}</a>
{% endblock %}

{% block content %}
<div class="container">
<div class="row">
Expand Down
7 changes: 0 additions & 7 deletions eruditorg/templates/public/journal/journal_base.html

This file was deleted.

39 changes: 38 additions & 1 deletion eruditorg/templates/public/journal/journal_detail.html
Original file line number Diff line number Diff line change
@@ -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 %}
Expand All @@ -19,6 +19,43 @@
<meta name="twitter:title" content="{{ journal.name }} – Érudit">
{% endblock meta_tags %}

{% block structured_data %}
{{ block.super }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}",
"name": "Érudit"
}
},{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_list' %}",
"name": "{% trans 'Revues' %}"
}
},{
"@type": "ListItem",
"position": 3,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_detail' journal.code %}",
"name": "{{ journal.name }}"
}
}]
}
</script>
{% endblock structured_data %}

{% block breadcrumb %}{{ block.super }}
/ <a href="{% url 'public:journal:journal_list' %}">{% trans "Revues" %}</a>
/ <a href="{% url 'public:journal:journal_detail' journal.code %}">{{ journal.name }}</a>
{% endblock %}

{% block content %}

{% trans "inconnu" as i18n_unknown %}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}",
"name": "Érudit"
}
},{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "{{ request.scheme }}://{{ request.site.domain }}{% url 'public:journal:journal_list' %}",
"name": "{% trans 'Revues' %}"
}
}]
}
</script>
{% 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 }}
/ <a href="{% url 'public:journal:journal_list' %}">{% trans "Revues" %}</a>
{% endblock %}

{% block content %}
<div id="journal_list_per_disciplines">

Expand Down
Loading

0 comments on commit 3912cf1

Please sign in to comment.