forked from mmcinnestaylor/Programming-Contest-Suite
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Documentation:
https://developers.google.com/search/docs/appearance/structured-data/event
https://schema.org/Event
Adding JSON-LD structured data for events allows Google to better understand and index the programming contest event information in a standardized, machine-readable format. The contest information can be eligible to be displayed in the Event section on Google. Inside src/core/templates/core/index.html in {% block head %}, add this:
<!-- Event Structured Data -->
{% if contest %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "ACM at FSU Programming Contest",
"description": "An ICPC-style programming contest hosted semesterly by the Florida State University Association for Computing Machinery Student Chapter. Teams of up to 3 members compete to solve coding challenges.",
{% if contest.contest_date and contest.contest_start %}
"startDate": "{{ contest.contest_date|date:'Y-m-d' }}T{{ contest.contest_start|time:'H:i:s' }}{{ contest.contest_date|date:'O' }}",
{% endif %}
{% if contest.contest_date and contest.contest_end %}
"endDate": "{{ contest.contest_date|date:'Y-m-d' }}T{{ contest.contest_end|time:'H:i:s' }}{{ contest.contest_date|date:'O' }}",
{% endif %}
"eventStatus": "https://schema.org/EventScheduled",
"eventAttendanceMode": "{% if contest.participation == 2 %}https://schema.org/OnlineEventAttendanceMode{% elif contest.participation == 3 %}https://schema.org/MixedEventAttendanceMode{% else %}https://schema.org/OfflineEventAttendanceMode{% endif %}",
"location": {
"@type": "Place",
"name": "James J. Love Building",
"address": {
"@type": "PostalAddress",
"streetAddress": "1017 Academic Way",
"addressLocality": "Tallahassee",
"addressRegion": "FL",
"postalCode": "32304",
"addressCountry": "US"
}
},
"organizer": {
"@type": "Organization",
"name": "ACM at Florida State University",
"url": "https://fsu.acm.org"
},
"image": "{{ request.scheme }}://{{ request.get_host }}{% static 'img/acm_fsu_diamond.png' %}",
"url": "{{ request.scheme }}://{{ request.get_host }}{% url 'index' %}"
}
</script>
{% endif %}The above code should be checked again for correctness.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Todo