Skip to content

Commit

Permalink
🐛(rdfa) fix error 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.
Fixed errors:
- Missing field 'hasCourseInstance'
- Either 'courseWorkload' or 'courseSchedule' should be specified (in 'hasCourseInstance')

fixes #2444
  • Loading branch information
igobranco committed Jun 27, 2024
1 parent ce11b21 commit f9d1f6e
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 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,21 @@ <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.
-->
{% 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 f9d1f6e

Please sign in to comment.