diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 6a8d4d794..6ea051ab9 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -7,8 +7,8 @@ {% block title %}{{ book|book_title }}{% endblock %} -{% block opengraph_images %} - {% include 'snippets/opengraph_images.html' with image=book.preview_image %} +{% block opengraph %} + {% include 'snippets/opengraph.html' with image=book.preview_image %} {% endblock %} {% block content %} diff --git a/bookwyrm/templates/feed/status.html b/bookwyrm/templates/feed/status.html index ed828ae01..ccec6503c 100644 --- a/bookwyrm/templates/feed/status.html +++ b/bookwyrm/templates/feed/status.html @@ -2,15 +2,13 @@ {% load feed_page_tags %} {% load i18n %} -{% block opengraph_images %} - -{% firstof status.book status.mention_books.first as book %} -{% if book %} - {% include 'snippets/opengraph_images.html' with image=preview %} -{% else %} - {% include 'snippets/opengraph_images.html' %} -{% endif %} - +{% block opengraph %} + {% firstof status.book status.mention_books.first as book %} + {% if book %} + {% include 'snippets/opengraph.html' with image=preview %} + {% else %} + {% include 'snippets/opengraph.html' %} + {% endif %} {% endblock %} @@ -44,4 +42,3 @@ {% endblock %} - diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index 81aaee575..e838ead12 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -15,20 +15,9 @@ - {% if preview_images_enabled is True %} - - {% else %} - - {% endif %} - - - - - - {% block opengraph_images %} - {% include 'snippets/opengraph_images.html' %} + {% block opengraph %} + {% include 'snippets/opengraph.html' %} {% endblock %} - {% block head_links %}{% endblock %} diff --git a/bookwyrm/templates/shelf/shelf.html b/bookwyrm/templates/shelf/shelf.html index 8bd040e05..79ec241be 100644 --- a/bookwyrm/templates/shelf/shelf.html +++ b/bookwyrm/templates/shelf/shelf.html @@ -8,8 +8,8 @@ {% include 'user/books_header.html' with shelf=shelf %} {% endblock %} -{% block opengraph_images %} - {% include 'snippets/opengraph_images.html' with image=user.preview_image %} +{% block opengraph %} + {% include 'snippets/opengraph.html' with image=user.preview_image %} {% endblock %} {% block content %} diff --git a/bookwyrm/templates/snippets/opengraph_images.html b/bookwyrm/templates/snippets/opengraph.html similarity index 55% rename from bookwyrm/templates/snippets/opengraph_images.html rename to bookwyrm/templates/snippets/opengraph.html index 9668c3d65..1e87a464f 100644 --- a/bookwyrm/templates/snippets/opengraph_images.html +++ b/bookwyrm/templates/snippets/opengraph.html @@ -1,6 +1,7 @@ {% load static %} {% if preview_images_enabled is True %} + {% if image %} @@ -9,6 +10,15 @@ {% endif %} {% else %} + {% endif %} + + + + + + + + diff --git a/bookwyrm/templates/user/layout.html b/bookwyrm/templates/user/layout.html index ecf36845c..dfc7efc9b 100755 --- a/bookwyrm/templates/user/layout.html +++ b/bookwyrm/templates/user/layout.html @@ -8,8 +8,8 @@ {% block title %}{{ user.display_name }}{% endblock %} -{% block opengraph_images %} - {% include 'snippets/opengraph_images.html' with image=user.preview_image %} +{% block opengraph %} + {% include 'snippets/opengraph.html' with image=user.preview_image %} {% endblock %} {% block content %}