Skip to content

Commit

Permalink
🐛(rdfa) fix errors on Google Search Console
Browse files Browse the repository at this point in the history
Google Search Console requires more information for the RDFa information.

fixes #2444
  • Loading branch information
igobranco committed Jun 26, 2024
1 parent ce11b21 commit e2e4fbf
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/richie/apps/courses/templates/courses/cms/course_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -368,22 +368,24 @@ <h2 class="course-detail__title">{% blocktrans context "course_detail__title" %}
{% block runs %}
<div class="course-detail__aside">
{% render_model_add course "" "" "get_admin_url_to_add_run" %}
{% with runs_dict=current_page.course.course_runs_dict %}
{% with open_visible_runs=runs_dict.0|add:runs_dict.1|add:runs_dict.2|visible_on_course_page:request.toolbar.edit_mode_active %}
<!--
As course runs are rendered through React, we use meta tags to
setup course runs RFDa properties.
-->
{% for run in open_visible_runs %}
<span rel="hasCourseInstance" typeof="CourseInstance">
<meta property="name" content="{{ run.title }}" />
<meta property="inLanguage" content="{{ run.get_languages_display }}" />
<meta property="courseMode" content="online" />
<meta property="startDate" content="{{ run.start|date:'Y-m-d' }}" />
<meta property="endDate" content="{{ run.end|date:'Y-m-d' }}" />
</span>
{% endfor %}
{% endwith %}
{% with runs=current_page.course.course_runs|visible_on_course_page:request.toolbar.edit_mode_active %}
<!--
As course runs are rendered through React, we use meta tags to
setup course runs RFDa properties.
-->
<span rel="offers" typeof="Offer">
<meta property="category" content="Partially Free" />
</span>
{% for run in runs %}
<span rel="hasCourseInstance" typeof="CourseInstance">
<meta property="name" content='{{ run.title|default:current_page.get_title }}' />
<meta property="inLanguage" content="{{ run.get_languages_display }}" />
<meta property="courseMode" content="online" />
<meta property="startDate" content="{{ run.start|date:'Y-m-d' }}" />
<meta property="endDate" content="{{ run.end|date:'Y-m-d' }}" />
<meta property="courseWorkload" content="{{ current_page.course.pt_effort }}" />
</span>
{% endfor %}
{% endwith %}
</div>
{% endblock runs %}
Expand Down

0 comments on commit e2e4fbf

Please sign in to comment.