Add opengraph image depending on context

This commit is contained in:
Joachim
2021-05-26 14:44:15 +02:00
parent 65de40a95a
commit e5e549d125
4 changed files with 23 additions and 7 deletions

View File

@ -1,8 +1,13 @@
{% extends 'layout.html' %}
{% load i18n %}{% load bookwyrm_tags %}{% load humanize %}{% load utilities %}
{% load i18n %}{% load bookwyrm_tags %}{% load humanize %}{% load utilities %}{% load layout %}
{% block title %}{{ book|book_title }}{% endblock %}
{% block opengraph_images %}
<meta name="twitter:image" content="{{ get_path }}/images/{{ book.preview_image }}">
<meta name="og:image" content="{{ get_path }}/images/{{ book.preview_image }}">
{% endblock %}
{% block content %}
{% with user_authenticated=request.user.is_authenticated can_edit_book=perms.bookwyrm.edit_book %}
<div class="block" itemscope itemtype="https://schema.org/Book">