Ajout des blocs Open Graph (titre, description, image) dans les templates pour améliorer le SEO.
This commit is contained in:
parent
93808cb16d
commit
99c21a3692
3 changed files with 7 additions and 1 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
{% extends 'layout.html' %}
|
{% extends 'layout.html' %}
|
||||||
{% block title %}{{ course.name }} : {{ lesson.name }}{% endblock %}
|
{% block title %}{{ course.name }} : {{ lesson.name }}{% endblock %}
|
||||||
|
{% block og_title %}{{ course.name }} : {{ lesson.name }}{% endblock %}
|
||||||
|
{% block description %}{{ lesson.description|truncatewords:20 }}{% endblock %}
|
||||||
|
{% block og_image %}{{ course.thumbnail.url }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<section>
|
<section>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
{% extends 'layout.html' %}
|
{% extends 'layout.html' %}
|
||||||
{% block title %}{{ course.name }}{% endblock %}
|
{% block title %}{{ course.name }}{% endblock %}
|
||||||
|
{% block og_title %}{{ course.name }}{% endblock %}
|
||||||
|
{% block description %}{{ course.description|truncatewords:20 }}{% endblock %}
|
||||||
|
{% block og_image %}{{ course.thumbnail.url }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<section>
|
<section>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
<meta property="og:title" content="{% block og_title %}{{ self.title }}{% endblock %}">
|
<meta property="og:title" content="{% block og_title %}{{ self.title }}{% endblock %}">
|
||||||
<meta property="og:description" content="{% block og_description %}Apprendre le développement web et la programmation.{% endblock %}">
|
<meta property="og:description" content="{% block og_description %}Apprendre le développement web et la programmation.{% endblock %}">
|
||||||
<meta property="og:image" content="{% block og_image %}{% static 'img/default-share-image.jpg' %}{% endblock %}">
|
<meta property="og:image" content="{% block og_image %}{% endblock %}">
|
||||||
<meta property="og:url" content="{{ request.build_absolute_uri }}">
|
<meta property="og:url" content="{{ request.build_absolute_uri }}">
|
||||||
<meta property="og:type" content="website">
|
<meta property="og:type" content="website">
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue