Skip to content

Commit

Permalink
Meta data for link previews #85
Browse files Browse the repository at this point in the history
  • Loading branch information
ethrgeist committed Apr 19, 2023
1 parent a11fcf9 commit d608cfc
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/crew/templates/signup.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% extends "base.html" %} {% block content %}{% load static %}

<script language="javascript">
$(document).ready(() => {
$('#signup').on('change', _ => {
Expand Down
8 changes: 5 additions & 3 deletions src/crew/views/signup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ def signup(request, slug):
skills = Skill.objects.all()
attendance_phases = Attendance.get_phases(event=event)
team_categories = TeamCategory.objects.all()
context = {
extra_context = {
"event": event,
"og_title": f"Crewanmeldung {event.name}",
"og_description": f"Crewanmeldung für die Veranstaltung {event.name}, sei Teil des Teams!",
"shirts": shirts,
"site_title": "Anmeldung",
"site_title": f"Crewanmeldung {event.name}",
"skills": skills,
"slug": slug,
"team_categories": team_categories,
"attendance_phases": attendance_phases,
}
return HttpResponse(template.render(context, request))
return HttpResponse(template.render(extra_context, request))


class SignupSubmittedView(DetailView):
Expand Down
7 changes: 7 additions & 0 deletions src/rockon/context_processors/get_domain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import annotations

from django.conf import settings


def get_domain(request):
return {"DOMAIN": settings.DOMAIN}
1 change: 1 addition & 0 deletions src/rockon/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"rockon.context_processors.app_info.get_build_date",
"rockon.context_processors.app_info.get_build_hash",
"rockon.context_processors.sentry_frontend.get_sentry_data",
"rockon.context_processors.get_domain.get_domain",
],
},
},
Expand Down
1 change: 1 addition & 0 deletions src/templates/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@
})
})
</script>
{% include "opengraph.html" %}
6 changes: 6 additions & 0 deletions src/templates/opengraph.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% load static %}
<meta property="og:url" content="{{ DOMAIN }}{{ request.request.get_full_path }}" />
<meta property="og:type" content="website" />
<meta property="og:title" content="{{ og_title|default:"rockon" }}" />
<meta property="og:description" content="{{ og_description|default:"Hi, ich bin Rockon und ich helfe beim Organisieren und Verwalten von Rocktreff und Spielfest Mariendorf" }}" />
<meta property="og:image" content="{{ DOMAIN }}{% static "assets/racoon.svg" %}" />

0 comments on commit d608cfc

Please sign in to comment.