Skip to content

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

Add default OpenGraph

Pacu29c5974bd368b
diff --git a/templates/base.html b/templates/base.html
index fbc7384b5e..fbf1d64ef6 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -11,8 +11,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{% block meta_description %}{% endblock %}">
<meta name="author" content="{% trans "Mirumee Software" context "Meta author text" %}">
- <meta name="theme-color" content="#21915a" />
+ <meta name="theme-color" content="#21915a">
+ <meta name="og:type" content="website">
{% endblock meta %}
+
{% include 'favicon.html' %}
{% render_bundle 'vendor' 'css' %}
{% render_bundle 'storefront' 'css' %}
@@ -20,7 +22,12 @@
{% block stylesheet %}{% endblock stylesheet %}
{% block meta_tags %}{% endblock meta_tags %}
- {% block meta_tags %}{% endblock meta_tags %}
+ {% block meta_tags %}
+ <meta property="og:title" content="{{ site.name }}">
+ <meta property="og:url" content="{{ request.get_full_path }}">
+ <meta property="og:image" content="{% static "images/logo.png" %}">
+ {% endblock meta_tags %}
+
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
diff --git a/templates/category/index.html b/templates/category/index.html
index e1adf48c1e..59985897f7 100644
--- a/templates/category/index.html
+++ b/templates/category/index.html
@@ -14,19 +14,19 @@
{% block meta_tags %}
<meta property="og:title" content="{{ category }} — {{ block.super }}">
- <meta name="og:description" content="{{ category.description }}">
- <meta property="og:image" content="{% static "images/logo.png" %}" />
+ <meta property="og:description" content="{{ category.description }}">
+ <meta property="og:image" content="{% static "images/logo.png" %}">
{% with category_url=category.get_absolute_url %}
<meta property="og:url" content="{{ category_url }}">
<link rel="canonical" href="{{ category_url }}?page={{ products_paginated.number }}">
{% if products_paginated.has_previous %}
- <link rel="prev" href="{{ category_url }}?page={{ products_paginated.previous_page_number }}" />
+ <link rel="prev" href="{{ category_url }}?page={{ products_paginated.previous_page_number }}">
{% endif %}
{% if products_paginated.has_next %}
- <link rel="next" href="{{ category_url }}?page={{ products_paginated.next_page_number }}" />
+ <link rel="next" href="{{ category_url }}?page={{ products_paginated.next_page_number }}">
{% endif %}
{% endwith %}
{% endblock meta_tags %}
diff --git a/templates/product/details.html b/templates/product/details.html
index 08a36e5d38..d6bc316105 100644
--- a/templates/product/details.html
+++ b/templates/product/details.html
@@ -14,7 +14,7 @@
{% block meta_tags %}
<meta property="og:title" content="{{ product }} — {{ block.super }}">
- <meta name="description" content="{{ product.description }}">
+ <meta property="og:description" content="{{ product.description }}">
{% with product_url=product.get_absolute_url %}
<meta property="og:url" content="{{ product_url }}">
@@ -26,6 +26,8 @@
<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/logo.png" %}">
{% endif %}
{% endblock meta_tags %}