Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Merge pull request #1448 from Pacu2/feature/opengraph-and-canonical

Marcin Gębala55a10af21343
diff --cc templates/product/details.html
index 48b9f9ad9c,2748a14b94..96cab7ab41
--- a/templates/product/details.html
+++ b/templates/product/details.html
@@@ -12,9 -13,27 +13,27 @@@
{% block meta_description %}{{ product.description }}{% endblock %}
+ {% block meta_tags %}
+ <meta property="og:title" content="{{ product }} — {{ block.super }}">
+ <meta property="og:description" content="{{ product.description }}">
+
+ {% build_absolute_uri request=request location=product.get_absolute_url as product_url %}
+ <meta property="og:url" content="{{ product_url }}">
+ <link rel="canonical" href="{{ product_url }}">
+
+ {% product_first_image product size="510x510" as product_image %}
+ {% if product_image %}
+ <meta property="og:image" content="{{ product_image }}" />
+ <meta property="og:image:width" content="510">
+ <meta property="og:image:height" content="510">
+ {% else %}
+ <meta property="og:image" content="{% static "images/block1.png" %}">
+ {% endif %}
+ {% endblock meta_tags %}
+
{% block breadcrumb %}
<ul class="breadcrumbs list-unstyled">
- <li><a href="/">
+ <li><a href="{% url 'home' %}">
{% trans "Home" context "Main navigation item" %}
</a></li>
{% with product.get_first_category as category %}