Skip to content

Commit

Permalink
Added metadata to events page (#1119)
Browse files Browse the repository at this point in the history
* Added metadata to events page

* change the metadata into a nextjs block and fixed formatting of the file

* Formatted the code

* Format

* Cleanup comment

---------

Co-authored-by: Brylie Christopher Oxley <[email protected]>
  • Loading branch information
ResendeTech and brylie committed Sep 20, 2024
1 parent 5cea94f commit 240b9fb
Showing 1 changed file with 31 additions and 19 deletions.
50 changes: 31 additions & 19 deletions events/templates/events/event.html
Original file line number Diff line number Diff line change
@@ -1,59 +1,71 @@
{% extends "base.html" %}
{% extends 'base.html' %}

{% load tz %}
{% load static wagtailcore_tags %}

{% block body_class %}template-event{% endblock %}
{% block body_class %}
template-event
{% endblock %}

{% block title %}{{ page.title }}{% endblock %}
{% block title %}
{{ page.title }}
{% endblock %}

{% block content %}
<a href="{% pageurl page.get_parent %}?caegory={{ page.category }}">
Events
</a>
<a href="{% pageurl page.get_parent %}?category={{ page.category }}">Events</a>

<h1>{{ event.title }}</h1>

<p class="font-weight-bold mb-2">
{% if event.start_date %}
{{ event.start_date | timezone:"US/Pacific" | date:"F d, Y, f A" }}
{{ event.start_date|timezone:'US/Pacific'|date:'F d, Y, f A' }}
{% endif %}

{% if event.end_date %}
-
{{ event.end_date | timezone:"US/Pacific" | date:"F d, Y, f A" }}
{% endif %}

US/Pacific
{{ event.end_date|timezone:'US/Pacific'|date:'F d, Y, f A' }}
{% endif %}US/Pacific
</p>

{% if event.sponsors.all %}
<dt class="col-sm-2">Sponsor(s):</dt>
<dd class="col-sm-10">
{% for sponsor in event.sponsors.all %}
{% if sponsor.sponsor.live %}
<a href="{% pageurl sponsor.sponsor %}">
{{ sponsor.sponsor }}</a>{% if not forloop.last %},{% endif %}
<a href="{% pageurl sponsor.sponsor %}">{{ sponsor.sponsor }}</a>{% if not forloop.last %},{% endif %}
{% else %}
{{ sponsor.sponsor }}{% if not forloop.last %},{% endif %}
{% endif %}
{% endfor %}
</dd>
{% endif %}


{% if event.body %}
{{ event.body }}
{% endif %}

{% if event.website %}
<a
href="{{ event.specific.website }}"
class="btn btn-primary btn-sm"
target="blank"
>
<a href="{{ event.specific.website }}" class="btn btn-primary btn-sm" target="blank">
<i class="bi bi-link" aria-hidden="true"></i>
Visit event website
</a>
{% endif %}
{% endblock %}

{% block extra_js %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Event",
"name": "{{ event.title|escapejs }}",
"startDate": "{% if event.start_date %}{{ event.start_date|date:'c' }}{% endif %}",
"endDate": "{% if event.end_date %}{{ event.end_date|date:'c' }}{% endif %}",
"eventStatus": "https://schema.org/EventScheduled",
"eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
"description": "{{ event.body|striptags|escapejs }}",
"url": "{{ request.build_absolute_uri }}",
"eventCategory": "{{ event.get_category_display|escapejs }}",
"eventWebsite": "{% if event.website %}{{ event.website }}{% endif %}"
}
</script>
{% endblock %}

0 comments on commit 240b9fb

Please sign in to comment.