forked from mirrors/bookwyrm
Better handling of absolute URLs with domain + scheme
This commit is contained in:
parent
d862be0564
commit
6607c8b185
2 changed files with 6 additions and 9 deletions
|
@ -11,9 +11,6 @@ def site_settings(request): # pylint: disable=unused-argument
|
||||||
return {
|
return {
|
||||||
"site": models.SiteSettings.objects.get(),
|
"site": models.SiteSettings.objects.get(),
|
||||||
"active_announcements": models.Announcement.active_announcements(),
|
"active_announcements": models.Announcement.active_announcements(),
|
||||||
"static_url": settings.STATIC_URL,
|
|
||||||
"media_url": settings.MEDIA_URL,
|
|
||||||
"static_path": settings.STATIC_PATH,
|
|
||||||
"media_path": settings.MEDIA_PATH,
|
"media_path": settings.MEDIA_PATH,
|
||||||
"preview_images_enabled": settings.ENABLE_PREVIEW_IMAGES,
|
"preview_images_enabled": settings.ENABLE_PREVIEW_IMAGES,
|
||||||
"request_protocol": request_protocol,
|
"request_protocol": request_protocol,
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{% if preview_images_enabled is True %}
|
{% if preview_images_enabled is True %}
|
||||||
{% if image %}
|
{% if image %}
|
||||||
<meta name="twitter:image" content="{{ request.scheme }}://{{ media_path }}{{ image }}">
|
<meta name="twitter:image" content="{{ media_path }}{{ image }}">
|
||||||
<meta name="og:image" content="{{ request.scheme }}://{{ media_path }}{{ image }}">
|
<meta name="og:image" content="{{ media_path }}{{ image }}">
|
||||||
{% else %}
|
{% else %}
|
||||||
<meta name="twitter:image" content="{{ request.scheme }}://{{ media_path }}{{ site.preview_image }}">
|
<meta name="twitter:image" content="{{ media_path }}{{ site.preview_image }}">
|
||||||
<meta name="og:image" content="{{ request.scheme }}://{{ media_path }}{{ site.preview_image }}">
|
<meta name="og:image" content="{{ media_path }}{{ site.preview_image }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<meta name="twitter:image" content="{{ request.scheme }}://{% if site.logo %}{{ media_path }}{{ site.logo }}{% else %}{{ static_path }}/images/logo.png{% endif %}">
|
<meta name="twitter:image" content="{% if site.logo %}{{ media_path }}{{ site.logo }}{% else %}{% static "images/logo.png" %}{% endif %}">
|
||||||
<meta name="og:image" content="{{ request.scheme }}://{% if site.logo %}{{ media_path }}{{ site.logo }}{% else %}{{ static_path }}/images/logo.png{% endif %}">
|
<meta name="og:image" content="{% if site.logo %}{{ media_path }}{{ site.logo }}{% else %}{% static "images/logo.png" %}{% endif %}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue