mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Add specific social media image
This commit is contained in:
@@ -59,7 +59,14 @@ def contextprocessor(request):
|
||||
|
||||
if request.event.settings.presale_css_file:
|
||||
ctx['css_file'] = default_storage.url(request.event.settings.presale_css_file)
|
||||
|
||||
ctx['event_logo'] = request.event.settings.get('logo_image', as_type=str, default='')[7:]
|
||||
ctx['social_image'] = request.event.cache.get_or_set(
|
||||
'social_image_url',
|
||||
request.event.social_image,
|
||||
60
|
||||
)
|
||||
|
||||
ctx['event'] = request.event
|
||||
ctx['languages'] = [get_language_info(code) for code in request.event.settings.locales]
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
{% if event.settings.meta_noindex %}
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
{% endif %}
|
||||
<meta property="og:type" content="website" />
|
||||
{% if social_image %}
|
||||
<meta property="og:image" content="{{ social_image }}" />
|
||||
{% endif %}
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
||||
{% block above %}
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
{{ block.super }}
|
||||
<meta property="og:title" content="{{ ev.name }}" />
|
||||
<meta property="og:description" content="{{ ev.get_date_range_display }}" />
|
||||
{% if event_logo %}
|
||||
<meta property="og:image" content="{{ event_logo|thumb:'5000x120' }}" />
|
||||
{% endif %}
|
||||
<meta property="og:type" content="website" />
|
||||
{% if subevent %}
|
||||
<meta property="og:url" content="{% abseventurl request.event "presale:event.index" subevent=subevent.pk %}" />
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user