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 21, 2024
1 parent ce11b21 commit 6051317
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 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,28 @@ <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' }}" />
{% 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" />
<span property="courseSchedule" typeof="Schedule">
<meta property="startDate" content="{{ run.start|date:'Y-m-d' }}" />
<meta property="endDate" content="{{ run.end|date:'Y-m-d' }}" />
<meta property="duration" content="{{ current_page.course.pt_effort }}" />
<meta property="repeatCount" content="1" />
<meta property="repeatFrequency" content="Weekly" />
</span>
{% endfor %}
{% endwith %}
</span>
{% endfor %}
{% endwith %}
</div>
{% endblock runs %}
Expand Down

0 comments on commit 6051317

Please sign in to comment.